In Makeconfig, similar to "pic-ccflag = -fPIC", the default for pie-ccflag should be '-fPIE' not '-fpie'. Otherwise, large projects using -static-pie may see, e.g. /usr/lib/gcc/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/lib/../lib/libc.a(init-first.o): in function `__libc_init_first': (.text+0x10): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `__environ' defined in .bss section in /usr/lib/gcc/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/lib/../lib/libc.a(environ.o) /usr/bin/ld: (.text+0x10): warning: too many GOT entries for -fpic, please recompile with -fPIC
Seems reasonable. Are you going to send a patch? Thanks.
(In reply to Florian Weimer from comment #1) > Seems reasonable. Are you going to send a patch? Thanks. 1049 # This can be changed by a sysdep makefile 1050 pic-ccflag = -fPIC 1051 # This one should always stay like this unless there is a very good reason. 1052 PIC-ccflag = -fPIC 1053 endif 1054 # This can be changed by a sysdep makefile 1055 pie-ccflag = -fpie Yes, for pic-ccflag we use -fPIC, but for pie-ccflags we only use -fPIE. These should be consistent one way or the other, and I wonder if that's a per-architecture choice that depends on the choices the compiler makes to support the larger code model. A high quality submission should discuss the visible code generation changes that the change brings.
Created attachment 14291 [details] patch
commit 51231c469b49fb3837590f40a93f88db9a20bb86 Author: Richard Henderson <richard.henderson@linaro.org> Date: Tue Aug 23 13:49:23 2022 -0700 Makeconfig: Set pie-ccflag to -fPIE by default [BZ# 29514] We should default to the larger code model, in order to support larger applications built with -static -pie. This should be consistent with pic-ccflag, which defaults to -fPIC. Remove the now redundant override from sysdeps/sparc/Makefile. Note that -fno-pie and -fno-PIE have the same effect. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>