New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: configure fails when cross-compiling with -std=c11 and -flto #618
Comments
|
Hi @fanquake which distro is this on and what's your version of GNU autoconf? The way I read The output What do you think? |
Ubuntu 22.04
Yes, however I'd left it out of the description for simplicity. I've added it now, the result is still the same. |
@fanquake thanks. Could you add your version of GCC and the full configure log as well? So far I have not been able to reproduce it over here with GCC 11.3.0. Are you experiencing this issue with nothing but Expat? E.g. could you try some other project using macro
Thanks for clearing that up. |
aarch64-linux-gnu-g++ (Ubuntu 11.2.0-17ubuntu1) 11.2.0 |
|
@fanquake thanks! Could you please try this minimal AC_INIT([issue618], [1.0], [foo@bar.invalid])
AC_CONFIG_HEADERS([issue618config.h])
AC_C_BIGENDIAN
AC_OUTPUT…and give it a spin using commands: # autoheader && autoconf && rm -Rf config.status autom4te.cache/ && ./configure --host=aarch64-linux-gnu CFLAGS="-std=c11 -flto" LDFLAGS="-flto"Thanks in advance! |
# cat configure.ac
AC_INIT([issue618], [1.0], [foo@bar.invalid])
AC_CONFIG_HEADERS([issue618config.h])
AC_C_BIGENDIAN
AC_OUTPUT# autoheader && autoconf && rm -Rf config.status autom4te.cache/ && ./configure --host=aarch64-linux-gnu CFLAGS="-std=c11 -flto" LDFLAGS="-flto"
checking for aarch64-linux-gnu-gcc... aarch64-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether aarch64-linux-gnu-gcc accepts -g... yes
checking for aarch64-linux-gnu-gcc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... unknown
configure: error: unknown endianness
presetting ac_cv_c_bigendian=no (or yes) will help |
|
@fanquake that was quick thank you! I don't see this as a bug in Expat then, and will hence close this issue as "not a bug in Expat". If you can take it to GNU autoconf upstream that would be welcome. If you consider this evaluation a mistake, please let me know so we can re-open the ticket if needed. |
|
Thanks. I've submitted this further upstream: https://savannah.gnu.org/support/index.php?110687. |
|
This has now been fixed in autoconf: https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=234fc6c86613ed3f366dd1d88996e4d5d85ee222. Sorry for the noise here. |
|
@fanquake cool! 🎉 |
Configuring for a cross-compile, while passing
-std=c11and-fltoto cflags causes configure to fail:My understanding is that some endianess macros used by the check, are not available with
-std=c11, and when building with-flto, fallback detection methods don't work.Passing
CPPFLAGS="-D_DEFAULT_SOURCE", which in turn defines__USE_MISC(features.h):which exposes additional definitions in
endian.h:gives a working configure.
The happens with the 2.4.8 tarball and building using master.
The text was updated successfully, but these errors were encountered: