* [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile
@ 2021-03-15 21:01 Carlos Eduardo Seo via Libc-alpha
2021-03-19 18:01 ` Szabolcs Nagy via Libc-alpha
2021-03-19 18:02 ` Florian Weimer
0 siblings, 2 replies; 6+ messages in thread
From: Carlos Eduardo Seo via Libc-alpha @ 2021-03-15 21:01 UTC (permalink / raw)
To: libc-alpha
Building dl-static is also needed when building glibc with --disable-shared.
Tested on aarch64-linux-gnu and powerpc64le-linux-gnu.
---
sysdeps/unix/sysv/linux/aarch64/Makefile | 2 --
sysdeps/unix/sysv/linux/arc/Makefile | 2 --
sysdeps/unix/sysv/linux/mips/Makefile | 2 --
sysdeps/unix/sysv/linux/powerpc/Makefile | 2 --
4 files changed, 8 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/aarch64/Makefile b/sysdeps/unix/sysv/linux/aarch64/Makefile
index 3f22f71bef..41b284df17 100644
--- a/sysdeps/unix/sysv/linux/aarch64/Makefile
+++ b/sysdeps/unix/sysv/linux/aarch64/Makefile
@@ -1,9 +1,7 @@
ifeq ($(subdir),elf)
-ifeq ($(build-shared),yes)
# This is needed for DSO loading from static binaries.
sysdep-dl-routines += dl-static
endif
-endif
ifeq ($(subdir),misc)
sysdep_headers += sys/elf.h
diff --git a/sysdeps/unix/sysv/linux/arc/Makefile b/sysdeps/unix/sysv/linux/arc/Makefile
index 25d7bbecac..4a49f34088 100644
--- a/sysdeps/unix/sysv/linux/arc/Makefile
+++ b/sysdeps/unix/sysv/linux/arc/Makefile
@@ -13,11 +13,9 @@ sysdep_routines += cacheflush
endif
ifeq ($(subdir),elf)
-ifeq ($(build-shared),yes)
# This is needed for DSO loading from static binaries.
sysdep-dl-routines += dl-static
endif
-endif
abi-variants := arcle arcbe
diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mips/Makefile
index 026ba242cf..805dd59bab 100644
--- a/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/sysdeps/unix/sysv/linux/mips/Makefile
@@ -57,10 +57,8 @@ abi-n64_hard_2008-condition := defined(__mips_nan2008) \
&& (_MIPS_SIM == _MIPS_SIM_ABI64)
ifeq ($(subdir),elf)
-ifeq ($(build-shared),yes)
# This is needed for DSO loading from static binaries.
sysdep-dl-routines += dl-static
-endif
# If the compiler doesn't use GNU.stack note,
# this test is expected to fail.
ifneq ($(mips-has-gnustack),yes)
diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile
index a093cda68b..c567d6782a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/Makefile
+++ b/sysdeps/unix/sysv/linux/powerpc/Makefile
@@ -13,10 +13,8 @@ gen-as-const-headers += ucontext_i.sym
endif
ifeq ($(subdir),elf)
-ifeq ($(build-shared),yes)
# This is needed for DSO loading from static binaries.
sysdep-dl-routines += dl-static
-endif
# Otherwise tst-tls-dlinfo fails due to tst-tlsmod2.so using static tls.
LDFLAGS-tst-tlsmod2.so += -Wl,--no-tls-get-addr-optimize
endif
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile
2021-03-15 21:01 [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile Carlos Eduardo Seo via Libc-alpha
@ 2021-03-19 18:01 ` Szabolcs Nagy via Libc-alpha
2021-03-19 18:02 ` Florian Weimer
1 sibling, 0 replies; 6+ messages in thread
From: Szabolcs Nagy via Libc-alpha @ 2021-03-19 18:01 UTC (permalink / raw)
To: Carlos Eduardo Seo; +Cc: libc-alpha
The 03/15/2021 18:01, Carlos Eduardo Seo via Libc-alpha wrote:
> Building dl-static is also needed when building glibc with --disable-shared.
>
> Tested on aarch64-linux-gnu and powerpc64le-linux-gnu.
This looks good to me.
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
> ---
> sysdeps/unix/sysv/linux/aarch64/Makefile | 2 --
> sysdeps/unix/sysv/linux/arc/Makefile | 2 --
> sysdeps/unix/sysv/linux/mips/Makefile | 2 --
> sysdeps/unix/sysv/linux/powerpc/Makefile | 2 --
> 4 files changed, 8 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/aarch64/Makefile b/sysdeps/unix/sysv/linux/aarch64/Makefile
> index 3f22f71bef..41b284df17 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/Makefile
> +++ b/sysdeps/unix/sysv/linux/aarch64/Makefile
> @@ -1,9 +1,7 @@
> ifeq ($(subdir),elf)
> -ifeq ($(build-shared),yes)
> # This is needed for DSO loading from static binaries.
> sysdep-dl-routines += dl-static
> endif
> -endif
>
> ifeq ($(subdir),misc)
> sysdep_headers += sys/elf.h
> diff --git a/sysdeps/unix/sysv/linux/arc/Makefile b/sysdeps/unix/sysv/linux/arc/Makefile
> index 25d7bbecac..4a49f34088 100644
> --- a/sysdeps/unix/sysv/linux/arc/Makefile
> +++ b/sysdeps/unix/sysv/linux/arc/Makefile
> @@ -13,11 +13,9 @@ sysdep_routines += cacheflush
> endif
>
> ifeq ($(subdir),elf)
> -ifeq ($(build-shared),yes)
> # This is needed for DSO loading from static binaries.
> sysdep-dl-routines += dl-static
> endif
> -endif
>
> abi-variants := arcle arcbe
>
> diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mips/Makefile
> index 026ba242cf..805dd59bab 100644
> --- a/sysdeps/unix/sysv/linux/mips/Makefile
> +++ b/sysdeps/unix/sysv/linux/mips/Makefile
> @@ -57,10 +57,8 @@ abi-n64_hard_2008-condition := defined(__mips_nan2008) \
> && (_MIPS_SIM == _MIPS_SIM_ABI64)
>
> ifeq ($(subdir),elf)
> -ifeq ($(build-shared),yes)
> # This is needed for DSO loading from static binaries.
> sysdep-dl-routines += dl-static
> -endif
> # If the compiler doesn't use GNU.stack note,
> # this test is expected to fail.
> ifneq ($(mips-has-gnustack),yes)
> diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile
> index a093cda68b..c567d6782a 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/Makefile
> +++ b/sysdeps/unix/sysv/linux/powerpc/Makefile
> @@ -13,10 +13,8 @@ gen-as-const-headers += ucontext_i.sym
> endif
>
> ifeq ($(subdir),elf)
> -ifeq ($(build-shared),yes)
> # This is needed for DSO loading from static binaries.
> sysdep-dl-routines += dl-static
> -endif
> # Otherwise tst-tls-dlinfo fails due to tst-tlsmod2.so using static tls.
> LDFLAGS-tst-tlsmod2.so += -Wl,--no-tls-get-addr-optimize
> endif
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile
2021-03-15 21:01 [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile Carlos Eduardo Seo via Libc-alpha
2021-03-19 18:01 ` Szabolcs Nagy via Libc-alpha
@ 2021-03-19 18:02 ` Florian Weimer
2021-03-30 20:45 ` Carlos Seo via Libc-alpha
2021-04-20 8:12 ` Szabolcs Nagy via Libc-alpha
1 sibling, 2 replies; 6+ messages in thread
From: Florian Weimer @ 2021-03-19 18:02 UTC (permalink / raw)
To: Carlos Eduardo Seo via Libc-alpha
* Carlos Eduardo Seo via Libc-alpha:
> Building dl-static is also needed when building glibc with
> --disable-shared.
Given
> # This is needed for DSO loading from static binaries.
I think this suggests that ideally, the code that needs this would be
disabled at build time, given that there is no DSO left to load in a
static-only build.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile
2021-03-19 18:02 ` Florian Weimer
@ 2021-03-30 20:45 ` Carlos Seo via Libc-alpha
2021-04-20 8:12 ` Szabolcs Nagy via Libc-alpha
1 sibling, 0 replies; 6+ messages in thread
From: Carlos Seo via Libc-alpha @ 2021-03-30 20:45 UTC (permalink / raw)
To: Florian Weimer; +Cc: Carlos Eduardo Seo via Libc-alpha
On Fri, 19 Mar 2021 at 15:03, Florian Weimer <fw@deneb.enyo.de> wrote:
>
> * Carlos Eduardo Seo via Libc-alpha:
>
> > Building dl-static is also needed when building glibc with
> > --disable-shared.
>
> Given
>
> > # This is needed for DSO loading from static binaries.
>
> I think this suggests that ideally, the code that needs this would be
> disabled at build time, given that there is no DSO left to load in a
> static-only build.
Do you want me to modify the original comment, or... ?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile
2021-03-19 18:02 ` Florian Weimer
2021-03-30 20:45 ` Carlos Seo via Libc-alpha
@ 2021-04-20 8:12 ` Szabolcs Nagy via Libc-alpha
2021-04-20 9:48 ` Florian Weimer
1 sibling, 1 reply; 6+ messages in thread
From: Szabolcs Nagy via Libc-alpha @ 2021-04-20 8:12 UTC (permalink / raw)
To: Florian Weimer; +Cc: Carlos Eduardo Seo via Libc-alpha
The 03/19/2021 19:02, Florian Weimer wrote:
> * Carlos Eduardo Seo via Libc-alpha:
>
> > Building dl-static is also needed when building glibc with
> > --disable-shared.
>
> Given
>
> > # This is needed for DSO loading from static binaries.
>
> I think this suggests that ideally, the code that needs this would be
> disabled at build time, given that there is no DSO left to load in a
> static-only build.
hm, yes dynamic loading from static linked binaries is not
needed in a static only build, but i think currently we
don't distinguish a static libc.a and a "static only" libc.a
we also need to keep some elf code because static pie still
needs self relocation.
i think if it's easy to rip out the dynamic loading code,
then it makes sense to do so (assuming static pie still works)
and if it's hard then it's ok to fix --disable-shared with
minimal effort and apply the patch.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile
2021-04-20 8:12 ` Szabolcs Nagy via Libc-alpha
@ 2021-04-20 9:48 ` Florian Weimer
0 siblings, 0 replies; 6+ messages in thread
From: Florian Weimer @ 2021-04-20 9:48 UTC (permalink / raw)
To: Szabolcs Nagy; +Cc: Carlos Eduardo Seo via Libc-alpha
* Szabolcs Nagy:
> i think if it's easy to rip out the dynamic loading code,
> then it makes sense to do so (assuming static pie still works)
> and if it's hard then it's ok to fix --disable-shared with
> minimal effort and apply the patch.
Agreed. I think it's become more difficult to rip out the dynamically
linked parts because the vDSO is now used in static binaries, too.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-04-20 9:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 21:01 [PATCH] elf: unconditionally add dl-static to sysdep-dl-routines in Makefile Carlos Eduardo Seo via Libc-alpha
2021-03-19 18:01 ` Szabolcs Nagy via Libc-alpha
2021-03-19 18:02 ` Florian Weimer
2021-03-30 20:45 ` Carlos Seo via Libc-alpha
2021-04-20 8:12 ` Szabolcs Nagy via Libc-alpha
2021-04-20 9:48 ` Florian Weimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).