[PATCH 3/3] install: Replace scripts/output-format.sed with objdump -f [BZ #26559]
Adhemerval Zanella
adhemerval.zanella@linaro.org
Tue Jan 12 12:00:41 GMT 2021
On 12/01/2021 08:20, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> On 28/12/2020 16:48, Fangrui Song via Libc-alpha wrote:
>>> GNU ld and gold have supported --print-output-format since 2011. glibc
>>> requires binutils>=2.25 (2015), so if LD is GNU ld or gold, we can
>>> assume the option is supported.
>>>
>>> lld is by default a cross linker supporting multiple targets. It auto
>>> detects the file format and does not need OUTPUT_FORMAT. It does not
>>> support --print-output-format.
>>>
>>> By parsing objdump -f, we can support all the three linkers.
>>
>> LGTM and this change seems orthogonal to the other lld adjustments.
>> I have checked that at least with a build for a handful of supported
>> ABIs I see no difference with ld.bfd (with multiple versions).
>
> I see a cross-build failure during the initial static link bootstrap on
> aarch64-linux-gnu during “make install”:
>
> make[2]: Entering directory '/home/bmg/src/glibc'
> aarch64-glibc-linux-gnu-gcc -shared -Wl,-dynamic-linker=/lib/ld-linux-aarch64.so.1 \
> -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both \
> -x c /dev/null -o /home/bmg/build/compilers/aarch64-linux-gnu/glibc/aarch64-linux-gnu/format.lds.so
> /home/bmg/install/compilers/aarch64-linux-gnu/lib/gcc/aarch64-glibc-linux-gnu/10.2.1/../../../../aarch64-glibc-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
> /home/bmg/install/compilers/aarch64-linux-gnu/lib/gcc/aarch64-glibc-linux-gnu/10.2.1/../../../../aarch64-glibc-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makerules:1070: /home/bmg/build/compilers/aarch64-linux-gnu/glibc/aarch64-linux-gnu/format.lds] Error 1
>
> This affects other targets as well.
>
> I guess using
>
> $(CC) -nostdlib -nostartfiles -shared -x assembler /dev/null
>
> should work on most targets here.
I haven't see it when a stage2 gcc, make install works as intended. However I
did see it now with a stage1 gcc with build-many-glibcs.py.
The -nostdlib -nostartfiles seems to fix it indeed, I am checking with a
bootstrap using build-many-glibcs.py.
More information about the Libc-alpha
mailing list