All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] LLVM builds broken by "-z text" (3a39e706a91a)
@ 2024-08-13 20:02 Markus Mayer via buildroot
  2024-08-13 20:13 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Mayer via buildroot @ 2024-08-13 20:02 UTC (permalink / raw)
  To: Buildroot Mailing List; +Cc: Yann E. MORIN

Hi all,

It looks like I am always the one finding corner case build problems.
Here is another one.

This commit

3a39e706a91a package/Makefile.in: work around buggy buildsystems wrt LDFLAGS

is causing this build a error when using LLVM for ARM64:

>>> argp-standalone 1.4.1 Patching libtool
[...]
configure: WARNING: unrecognized options: --disable-gtk-doc,
--disable-gtk-doc-html, --disable-doc, --disable-docs,
--disable-documentation, --with-xmlto, --with-fop, --enable-ipv6,
--disable-nls, --disable-static, --enable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for aarch64-buildroot-linux-musl-strip...
/storage/Extra/buildroot/output/stbllvm-13.0-0.6/arm64/host/bin/aarch64-linux-strip
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for aarch64-buildroot-linux-musl-gcc...
/storage/Extra/buildroot/output/stbllvm-13.0-0.6/arm64/host/bin/aarch64-linux-gcc
checking whether the C compiler works... no
configure: error: in
'/storage/Extra/buildroot/output/stbllvm-13.0-0.6/arm64/build/argp-standalone-1.4.1':
configure: error: C compiler cannot create executables
See 'config.log' for more details
make[1]: *** [package/pkg-generic.mk:289:
/storage/Extra/buildroot/output/stbllvm-13.0-0.6/arm64/build/argp-standalone-1.4.1/.stamp_configured]
Error 77
make: *** [Makefile:29: _all] Error 2

Checking build/argp-standalone-1.4.1/config.log, we see the following:

configure:3801: checking whether the C compiler works
configure:3823:
/storage/Extra/buildroot/output/stbllvm-13.0-0.6/arm64/host/bin/aarch64-linux-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2
-g0  -fPIC -fgnu89-inline -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64  -ztext conftest.c  >&5
clang-13: error: unknown argument '-ztext'; did you mean '-Ttext'?

So, it looks like argp-standalone is passing the value from
TARGET_LDFLAGS to the C compiler, and clang objects to "-ztext"
whereas gcc doesn't complain. I don't yet know if argp-standalone is
doing something it shouldn't. For now, it all seems to be in order. I
also don't know at this time if other packages would fail with a
similar error or if it is limited to argp-standalone. I will try to
find out.

The problem stems from an incompatibility between clang and GCC in how
they treat "-ztext" vs. "-z text". GCC doesn't care, but clang only
works if there is a space.

$ clang -ztext
clang: error: unknown argument: '-ztext'
clang: error: no input files
$ clang -z text
ld: unknown options: -z
clang: error: linker command failed with exit code 1 (use -v to see invocation)

In other words, when the space is present, the argument is passed to
the linker. When it's one word, the compiler tries to parse it itself
and fails.

On the other hand, gcc doesn't care if there's a space or not.

$ gcc -z text
gcc: fatal error: no input files
compilation terminated.
$ gcc -ztext
gcc: fatal error: no input files
compilation terminated.

What is the best way to address this without breaking other things as
this seems to be quite finicky?

Thanks,
-Markus
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-14  5:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-13 20:02 [Buildroot] LLVM builds broken by "-z text" (3a39e706a91a) Markus Mayer via buildroot
2024-08-13 20:13 ` Yann E. MORIN
2024-08-13 20:41   ` Markus Mayer via buildroot
2024-08-14  4:11     ` Markus Mayer via buildroot
2024-08-14  5:52       ` yann.morin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.