diff mbox series

[1/1] package/libutempter: do not hardcode PIE

Message ID 20240504091515.365847-1-fontaine.fabrice@gmail.com
State Superseded
Headers show
Series [1/1] package/libutempter: do not hardcode PIE | expand

Commit Message

Fabrice Fontaine May 4, 2024, 9:15 a.m. UTC
PIE will be set by buildroot if the user wants it so set LINK_PIE to an
empty value to fix the following build failure raised since the addition
of the package in commit 02c818bc5c7a6967a212f12e4caa8ccdfa0b452b:

/home/buildroot/autobuild/run/instance-3/output-1/host/bin/m68k-linux-gcc -W -Wall -Waggregate-return -Wcast-align -Wconversion -Wdisabled-optimization -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2 -g0   -std=gnu99  -DLIBEXECDIR=\"/usr/lib\" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-z,relro -Wl,-stats   -fPIE -pie -Wl,-z,now  utempter.c -o utempter

[...]

/home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/m68k-buildroot-linux-uclibc/12.3.0/../../../../m68k-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/run/instance-3/output-1/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/Scrt1.o: in function `lib_main':
(.text+0x4): undefined reference to `__shared_flat_add_library'

Fixes: 02c818bc5c7a6967a212f12e4caa8ccdfa0b452b
 - http://autobuild.buildroot.org/results/3a5581fd4edf56bbdc48ab111a2351fc70f1c703

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/libutempter/libutempter.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yann E. MORIN May 5, 2024, 5:45 p.m. UTC | #1
Fabrice, All,

On 2024-05-04 11:15 +0200, Fabrice Fontaine spake thusly:
> PIE will be set by buildroot if the user wants it so set LINK_PIE to an
> empty value to fix the following build failure raised since the addition
> of the package in commit 02c818bc5c7a6967a212f12e4caa8ccdfa0b452b:
> 
> /home/buildroot/autobuild/run/instance-3/output-1/host/bin/m68k-linux-gcc -W -Wall -Waggregate-return -Wcast-align -Wconversion -Wdisabled-optimization -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2 -g0   -std=gnu99  -DLIBEXECDIR=\"/usr/lib\" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-z,relro -Wl,-stats   -fPIE -pie -Wl,-z,now  utempter.c -o utempter
> 
> [...]
> 
> /home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/m68k-buildroot-linux-uclibc/12.3.0/../../../../m68k-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/run/instance-3/output-1/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/Scrt1.o: in function `lib_main':
> (.text+0x4): undefined reference to `__shared_flat_add_library'
> 
> Fixes: 02c818bc5c7a6967a212f12e4caa8ccdfa0b452b
>  - http://autobuild.buildroot.org/results/3a5581fd4edf56bbdc48ab111a2351fc70f1c703
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/libutempter/libutempter.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/libutempter/libutempter.mk b/package/libutempter/libutempter.mk
> index d51f70049c..b6e77449c6 100644
> --- a/package/libutempter/libutempter.mk
> +++ b/package/libutempter/libutempter.mk
> @@ -11,7 +11,7 @@ LIBUTEMPTER_LICENSE = LGPL-2.1+
>  LIBUTEMPTER_LICENSE_FILES = COPYING
>  
>  define LIBUTEMPTER_BUILD_CMDS
> -	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
> +	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) LINK_PIE=

Why don't we also need to pass COMPILE_PIE= (empty) to also disable
-fPIE at compile time?

Regards,
Yann E. MORIN.

>  endef
>  
>  define LIBUTEMPTER_INSTALL_STAGING_CMDS
> -- 
> 2.43.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/libutempter/libutempter.mk b/package/libutempter/libutempter.mk
index d51f70049c..b6e77449c6 100644
--- a/package/libutempter/libutempter.mk
+++ b/package/libutempter/libutempter.mk
@@ -11,7 +11,7 @@  LIBUTEMPTER_LICENSE = LGPL-2.1+
 LIBUTEMPTER_LICENSE_FILES = COPYING
 
 define LIBUTEMPTER_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) LINK_PIE=
 endef
 
 define LIBUTEMPTER_INSTALL_STAGING_CMDS