[systemd-devel] [PATCH] build-sys: use -fno-semantic-interposition if available

Lennart Poettering lennart at poettering.net
Mon Jan 26 16:04:59 PST 2015


On Sun, 25.01.15 18:46, Cristian Rodríguez (crrodriguez at opensuse.org) wrote:

> GCC5 introduces -fno-semantic-interposition allowing
> better code generation in shared libraries at the cost
> of making interposition of exported symbols impossible
> (i.e, a 3rd party shared library overriding sd_notify() will not work)
> Using this particular feature with systemd is not supported
> and crazy, so do not pay the cost of it.

Hmm, I know that at least Rocket overrides some of nspawn's symbols
with LD_PRELOAD tricks. Not sure I like it, but I am also not sure I
want to break stuff like this so just like that. I mean LD_PRELOAD is
a hack, but might be a hack one wants to allow?

> ---
>  configure.ac | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 12e4ab2..e4d7c05 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -199,6 +199,7 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
>          -fdata-sections \
>          -fstack-protector \
>          -fstack-protector-strong \
> +        -fno-semantic-interposition \
>          -fPIE \
>          --param=ssp-buffer-size=4])
>  
> -- 
> 2.2.2
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list