Skip to content
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

[package] m4/1.4.18: Cannot cross-compile x86_64 -> armhf #6777

Closed
xakod opened this issue Aug 9, 2021 · 36 comments
Closed

[package] m4/1.4.18: Cannot cross-compile x86_64 -> armhf #6777

xakod opened this issue Aug 9, 2021 · 36 comments
Labels
bug Something isn't working

Comments

@xakod
Copy link
Contributor

xakod commented Aug 9, 2021

Package and Environment Details (include every applicable attribute)

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

target_host=arm-linux-gnueabihf

[settings]
os=Linux
arch=armv7hf
compiler=clang
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
CC=/usr/bin/clang
CXX=/usr/bin/clang++
CXXFLAGS="-target arm-linux-gnueabihf" 
CFLAGS="-target arm-linux-gnueabihf" 
CHOST=$target_host
AR=$target_host-ar
AS=$target_host-as
RANLIB=$target_host-ranlib
LD=$target_host-ld
STRIP=$target_host-strip

Steps to reproduce (Include if Applicable)

conan install m4/1.4.18@ --profile armhf --build

Logs (Include/Attach if Applicable)

Click to expand log
user@e1eb53eb028f:~$ conan install m4/1.4.18@ --profile armhf --build 
Configuration:
[settings]
arch=armv7hf
build_type=Release
compiler=clang
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[options]
[build_requires]
[env]
AR=arm-linux-gnueabihf-ar
AS=arm-linux-gnueabihf-as
CC=/usr/bin/clang
CFLAGS=-target arm-linux-gnueabihf
CHOST=arm-linux-gnueabihf
CXX=/usr/bin/clang++
CXXFLAGS=-target arm-linux-gnueabihf
LD=arm-linux-gnueabihf-ld
RANLIB=arm-linux-gnueabihf-ranlib
STRIP=arm-linux-gnueabihf-strip
m4/1.4.18: Forced build from source
Installing package: m4/1.4.18
Requirements
    m4/1.4.18 from 'conancenter' - Cache
Packages
    m4/1.4.18:3386fb6a91a12a047a2d351791c92b1cd6efb4e2 - Build

Cross-build from 'Linux:x86_64' to 'Linux:armv7hf'
Installing (downloading, building) binaries...
Downloading conan_sources.tgz completed [6.39k]                                          
Decompressing conan_sources.tgz completed [0.00k]                                        
m4/1.4.18: Configuring sources in /home/user/.conan/data/m4/1.4.18/_/_/source
Downloading m4-1.4.18.tar.bz2 completed [1481.41k]                                       

m4/1.4.18: Copying sources to build folder
m4/1.4.18: Building your package in /home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2
m4/1.4.18: Generator txt created conanbuildinfo.txt
m4/1.4.18: Aggregating env generators
m4/1.4.18: Calling build()
m4/1.4.18: Calling:
 > source_subfolder/configure '--prefix=/home/user/.conan/data/m4/1.4.18/_/_/package/3386fb6a91a12a047a2d351791c92b1cd6efb4e2' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' --build=x86_64-linux-gnu --host=arm-linux-gnueabihf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-gnueabihf-strip... arm-linux-gnueabihf-strip
checking for a thread-safe mkdir -p... /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 nested variables... (cached) yes
checking for arm-linux-gnueabihf-gcc... /usr/bin/clang
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 we are using the GNU C compiler... yes
checking whether /usr/bin/clang accepts -g... yes
checking for /usr/bin/clang option to accept ISO C89... none needed
checking whether /usr/bin/clang understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /usr/bin/clang... gcc3
checking how to run the C preprocessor... /usr/bin/clang -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for Minix Amsterdam compiler... no
checking for arm-linux-gnueabihf-ar... arm-linux-gnueabihf-ar
checking the archiver (arm-linux-gnueabihf-ar) interface... ar
checking for arm-linux-gnueabihf-ar... (cached) arm-linux-gnueabihf-ar
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabihf
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for /usr/bin/clang option to accept ISO C99... none needed
checking for /usr/bin/clang option to accept ISO Standard C... (cached) none needed
configure: autobuild project... GNU M4
configure: autobuild revision... 1.4.18
configure: autobuild hostname... e1eb53eb028f
configure: autobuild timestamp... 20210809T095141Z
checking for unsigned long long int... yes
checking for long long int... yes
checking for unsigned long long int... (cached) yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking whether <wchar.h> uses 'inline' correctly... yes
checking for btowc... yes
checking for setrlimit... yes
checking for sigaltstack... yes
checking for canonicalize_file_name... yes
checking for getcwd... yes
checking for readlink... yes
checking for realpath... yes
checking for _set_invalid_parameter_handler... no
checking for fcntl... yes
checking for symlink... yes
checking for mempcpy... yes
checking for fpurge... no
checking for __fpurge... yes
checking for __freadahead... no
checking for __freading... yes
checking for getdtablesize... yes
checking for getprogname... no
checking for getexecname... no
checking for gettimeofday... yes
checking for lstat... yes
checking for mbsinit... yes
checking for mbrtowc... yes
checking for mprotect... yes
checking for mkstemp... yes
checking for nl_langinfo... yes
checking for pipe2... yes
checking for isblank... yes
checking for iswctype... yes
checking for link... yes
checking for secure_getenv... yes
checking for getuid... yes
checking for geteuid... yes
checking for getgid... yes
checking for getegid... yes
checking for sigaction... yes
checking for siginterrupt... yes
checking for snprintf... yes
checking for strndup... yes
checking for pipe... yes
checking for vasnprintf... no
checking for wcrtomb... yes
checking for iswcntrl... yes
checking for newlocale... yes
checking for setenv... yes
checking for sleep... yes
checking for strdup... yes
checking for wctob... yes
checking for nl_langinfo and CODESET... yes
checking for a traditional french locale... none
checking for ucontext.h... yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for sys/socket.h... yes
checking for stdio_ext.h... yes
checking for sys/stat.h... (cached) yes
checking for getopt.h... yes
checking for sys/time.h... yes
checking for langinfo.h... yes
checking for limits.h... yes
checking for xlocale.h... no
checking for math.h... yes
checking for sys/mman.h... yes
checking for malloc.h... yes
checking for sys/cdefs.h... yes
checking for spawn.h... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for sys/wait.h... yes
checking for features.h... yes
checking for wctype.h... yes
checking for dirent.h... yes
checking for inttypes.h... (cached) yes
checking for working C stack overflow detection... cross-compiling
checking for ld used by /usr/bin/clang... arm-linux-gnueabihf-ld
checking if the linker (arm-linux-gnueabihf-ld) is GNU ld... yes
checking for shared library run path origin... done
checking for libsigsegv... no, consider installing GNU libsigsegv
checking whether // is distinct from /... unknown, assuming no
checking whether realpath works... guessing yes
checking if environ is properly declared... yes
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking for complete errno.h... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking for mode_t... yes
checking for sig_atomic_t... yes
checking for working fcntl.h... cross-compiling
checking for pid_t... yes
checking whether frexp() can be used without linking with libm... yes
checking whether alarm is declared... yes
checking whether long double and double are the same... no
checking whether stdin defaults to large file offsets... yes
checking whether fseeko is declared... yes
checking for fseeko... yes
checking whether fflush works on input streams... cross
checking whether stat file-mode macros are broken... no
checking for nlink_t... yes
checking whether ftello is declared... yes
checking for ftello... yes
checking whether ftello works... guessing yes
checking whether getdtablesize is declared... yes
checking for getopt.h... (cached) yes
checking for getopt_long_only... yes
checking whether getopt is POSIX compatible... guessing yes
checking for working GNU getopt function... guessing no
checking whether getenv is declared... yes
checking for C/C++ restrict keyword... __restrict
checking for struct timeval... yes
checking for wide-enough struct timeval.tv_sec member... yes
checking where to find the exponent in a 'double'... word 1 bit 20
checking where to find the exponent in a 'float'... word 0 bit 23
checking whether byte ordering is bigendian... (cached) no
checking whether limits.h has ULLONG_WIDTH etc.... yes
checking whether getc_unlocked is declared... yes
checking whether we are using the GNU C Library >= 2.1 or uClibc... yes
checking for wchar_t... yes
checking for max_align_t... yes
checking whether NULL can be used in arbitrary expressions... yes
checking for multithread API to use... none
checking whether lstat correctly handles trailing slash... guessing yes
checking for a sed that does not truncate output... /bin/sed
checking whether malloc, realloc, calloc are POSIX compliant... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for mbstate_t... yes
checking for a traditional japanese locale... none
checking for a transitional chinese locale... none
checking for a french Unicode locale... none
checking for mmap... yes
checking for MAP_ANONYMOUS... yes
checking whether memchr works... guessing no
checking whether <limits.h> defines MIN and MAX... no
checking whether <sys/param.h> defines MIN and MAX... yes
checking for promoted mode_t type... mode_t
checking for library containing posix_spawn... none required
checking for posix_spawn... yes
checking whether posix_spawn works... guessing yes
checking whether posix_spawnattr_setschedpolicy is supported... yes
checking whether posix_spawnattr_setschedparam is supported... yes
checking for sigset_t... yes
checking for SIGPIPE... yes
checking for inline... inline
checking for uid_t in sys/types.h... yes
checking whether C symbols are prefixed with underscore at the linker level... no
checking whether snprintf returns a byte count as in C99... guessing yes
checking whether snprintf is declared... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for wint_t... yes
checking whether wint_t is too small... no
checking whether stdint.h conforms to C99... yes
checking whether stdint.h predates C++11... no
checking whether stdint.h has UINTMAX_WIDTH etc.... yes
checking whether strerror(0) succeeds... guessing yes
checking whether strndup is declared... yes
checking whether strnlen is declared... yes
checking whether strsignal is declared... yes
checking whether sys_siglist is declared... yes
checking whether ldexp() can be used without linking with libm... yes
checking for struct timespec in <time.h>... yes
checking whether clearerr_unlocked is declared... yes
checking whether feof_unlocked is declared... yes
checking whether ferror_unlocked is declared... yes
checking whether fflush_unlocked is declared... yes
checking whether fgets_unlocked is declared... yes
checking whether fputc_unlocked is declared... yes
checking whether fputs_unlocked is declared... yes
checking whether fread_unlocked is declared... yes
checking whether fwrite_unlocked is declared... yes
checking whether getchar_unlocked is declared... yes
checking whether putc_unlocked is declared... yes
checking whether putchar_unlocked is declared... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for intmax_t... yes
checking for snprintf... (cached) yes
checking for strnlen... yes
checking for wcslen... yes
checking for wcsnlen... yes
checking for mbrtowc... (cached) yes
checking for wcrtomb... (cached) yes
checking whether _snprintf is declared... no
checking whether printf supports size specifiers as in C99... guessing yes
checking whether printf supports 'long double' arguments... guessing yes
checking whether printf supports infinite 'double' arguments... guessing yes
checking whether printf supports infinite 'long double' arguments... guessing yes
checking whether printf supports the 'a' and 'A' directives... guessing yes
checking whether printf supports the 'F' directive... guessing yes
checking whether printf supports the 'n' directive... guessing yes
checking whether printf supports the 'ls' directive... guessing yes
checking whether printf supports the grouping flag... guessing yes
checking whether printf supports the left-adjust flag correctly... guessing yes
checking whether printf supports the zero flag correctly... guessing yes
checking whether printf supports large precisions... guessing yes
checking whether printf survives out-of-memory conditions... guessing yes
checking whether to use C++... no
checking whether ungetc works on arbitrary bytes... guessing yes
checking whether getcwd (NULL, 0) allocates memory for result... guessing yes
checking for getcwd with POSIX signature... yes
checking for inttypes.h... (cached) yes
checking whether the inttypes.h PRIxNN macros are broken... no
checking for LC_MESSAGES... yes
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking whether setenv is declared... yes
checking search.h usability... yes
checking search.h presence... yes
checking for search.h... yes
checking for tsearch... yes
checking whether strdup is declared... yes
checking whether unsetenv is declared... yes
checking for alloca as a compiler built-in... yes
checking whether to enable assertions... yes
checking whether btowc(0) is correct... guessing yes
checking whether btowc(EOF) is correct... guessing yes
checking for __builtin_expect... yes
checking whether sigaltstack is declared... yes
checking for stack_t... yes
checking whether // is distinct from /... (cached) unknown, assuming no
checking whether dup2 works... guessing yes
checking for error_at_line... yes
checking whether fflush works on input streams... (cached) cross
checking whether fcntl handles F_DUPFD correctly... guessing yes
checking whether fcntl understands F_DUPFD_CLOEXEC... needs runtime check
checking whether fflush works on input streams... (cached) cross
checking whether conversion from 'int' to 'long double' works... guessing yes
checking whether fopen recognizes a trailing slash... guessing yes
checking for __fpending... yes
checking whether __fpending is declared... yes
checking whether fpurge is declared... no
checking whether frexp works... guessing yes
checking whether frexpl is declared... yes
checking whether frexpl() can be used without linking with libm... yes
checking whether frexpl works... guessing yes
checking for fseeko... (cached) yes
checking whether fflush works on input streams... (cached) cross
checking for _fseeki64... no
checking for ftello... (cached) yes
checking whether ftello works... (cached) guessing yes
checking whether getdtablesize works... guessing yes
checking whether program_invocation_name is declared... yes
checking whether program_invocation_short_name is declared... yes
checking whether __argv is declared... no
checking whether gettimeofday clobbers localtime buffer... guessing no
checking for gettimeofday with POSIX signature... almost
checking whether isnan(double) can be used without linking with libm... yes
checking whether isnan(float) can be used without linking with libm... no
checking where to find the exponent in a 'float'... (cached) word 0 bit 23
checking whether isnan(long double) can be used without linking with libm... no
checking where to find the exponent in a 'long double'... unknown
checking whether langinfo.h defines CODESET... yes
checking whether langinfo.h defines T_FMT_AMPM... yes
checking whether langinfo.h defines ERA... yes
checking whether langinfo.h defines YESEXPR... yes
checking for libsigsegv... (cached) no, consider installing GNU libsigsegv
checking whether locale.h conforms to POSIX:2001... yes
checking whether struct lconv is properly defined... yes
checking whether lseek detects pipes... yes
checking whether NAN macro works... yes
checking whether HUGE_VAL works... yes
checking whether mbrtowc handles incomplete characters... guessing yes
checking whether mbrtowc works as well as mbtowc... guessing yes
checking whether mbrtowc handles a NULL pwc argument... guessing yes
checking whether mbrtowc handles a NULL string argument... guessing yes
checking whether mbrtowc has a correct return value... guessing yes
checking whether mbrtowc returns 0 when parsing a NUL character... guessing yes
checking whether mbrtowc works on empty input... guessing no
checking whether the C locale is free of encoding errors... guessing no
checking whether mbrtowc handles incomplete characters... (cached) guessing yes
checking whether mbrtowc works as well as mbtowc... (cached) guessing yes
checking bp-sym.h usability... no
checking bp-sym.h presence... no
checking for bp-sym.h... no
checking for mkdtemp... yes
checking for working mkstemp... guessing yes
checking whether YESEXPR works... guessing yes
checking for obstacks that work with any size object... no
checking whether open recognizes a trailing slash... guessing yes
checking whether posix_spawn_file_actions_addclose works... guessing yes
checking whether posix_spawn_file_actions_adddup2 works... guessing yes
checking whether posix_spawn_file_actions_addopen works... guessing yes
checking whether frexp works... (cached) guessing yes
checking whether ldexp can be used without linking with libm... (cached) yes
checking whether frexpl() can be used without linking with libm... (cached) yes
checking whether frexpl works... (cached) guessing yes
checking whether frexpl is declared... (cached) yes
checking whether ldexpl() can be used without linking with libm... yes
checking whether ldexpl works... guessing yes
checking whether ldexpl is declared... yes
checking whether program_invocation_name is declared... (cached) yes
checking whether program_invocation_short_name is declared... (cached) yes
checking for raise... yes
checking for sigprocmask... yes
checking for rawmemchr... yes
checking whether readlink signature is correct... yes
checking whether readlink handles trailing slash correctly... guessing yes
checking for working re_compile_pattern... no
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking whether isblank is declared... yes
checking whether rename honors trailing slash on destination... guessing yes
checking whether rename honors trailing slash on source... guessing yes
checking whether rename manages hard links correctly... guessing yes
checking whether rename manages existing destinations correctly... guessing yes
checking whether rmdir works... guessing yes
checking for struct sigaction.sa_sigaction... yes
checking for volatile sig_atomic_t... yes
checking for sighandler_t... yes
checking for signbit macro... guessing yes
checking for signbit compiler built-ins... guessing yes
checking for sigprocmask... (cached) yes
checking for stdint.h... (cached) yes
checking for SIZE_MAX... yes
checking for snprintf... (cached) yes
checking whether snprintf respects a size of 1... guessing yes
checking whether printf supports POSIX/XSI format strings with positions... guessing yes
checking for posix_spawnattr_t... yes
checking for posix_spawn_file_actions_t... yes
checking for ssize_t... yes
checking whether stat handles trailing slashes on directories... guessing yes
checking whether stat handles trailing slashes on files... guessing yes
checking for va_copy... yes
checking for max_align_t... (cached) yes
checking whether NULL can be used in arbitrary expressions... (cached) yes
checking which flavor of printf attribute matches inttypes macros... system
checking for strchrnul... yes
checking whether strchrnul works... guessing yes
checking for working strerror function... guessing yes
checking for working strndup... guessing yes
checking for working strnlen... yes
checking for strsignal... yes
checking whether strsignal always returns a string... guessing yes
checking whether strtod obeys C99... guessing yes
checking for nlink_t... (cached) yes
checking for ptrdiff_t... yes
checking for vasprintf... yes
checking for vasprintf... (cached) yes
checking for waitid... yes
checking whether mbrtowc handles incomplete characters... (cached) guessing yes
checking whether mbrtowc works as well as mbtowc... (cached) guessing yes
checking whether wcrtomb return value is correct... guessing yes
checking whether iswcntrl works... guessing yes
checking for towlower... yes
checking for wctype_t... yes
checking for wctrans_t... yes
checking for stdint.h... (cached) yes
checking for a traditional french locale... (cached) none
checking for a french Unicode locale... (cached) none
checking for a traditional french locale... (cached) none
checking for a turkish Unicode locale... none
checking for closedir... yes
checking for dirfd... yes
checking whether dirfd is declared... yes
checking whether dirfd is a macro... no
checking whether dup works... guessing yes
checking whether fdopen sets errno... guessing yes
checking for flexible array member... yes
checking for getpagesize... yes
checking whether getpagesize is declared... yes
checking whether INT32_MAX < INTMAX_MAX... yes
checking whether INT64_MAX == LONG_MAX... yes
checking whether UINT32_MAX < UINTMAX_MAX... yes
checking whether UINT64_MAX == ULONG_MAX... yes
checking where to find the exponent in a 'double'... (cached) word 1 bit 20
checking where to find the exponent in a 'float'... (cached) word 0 bit 23
checking where to find the exponent in a 'long double'... (cached) unknown
checking whether link obeys POSIX... guessing yes
checking for setlocale... yes
checking for uselocale... yes
checking for getlocalename_l... no
checking for a traditional french locale... (cached) none
checking for a french Unicode locale... (cached) none
checking for a traditional japanese locale... (cached) none
checking for a transitional chinese locale... (cached) none
checking for a french Unicode locale... (cached) none
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking for a traditional french locale... (cached) none
checking for a french Unicode locale... (cached) none
checking for opendir... yes
checking for putenv compatible with GNU and SVID... guessing yes
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking for readdir... yes
checking whether setenv validates arguments... guessing yes
checking for a traditional french locale... (cached) none
checking for a french Unicode locale... (cached) none
checking for a traditional japanese locale... (cached) none
checking for a transitional chinese locale... (cached) none
checking whether sleep is declared... yes
checking for working sleep... guessing yes
checking for working stdalign.h... yes
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking whether symlink handles trailing slash correctly... guessing yes
checking for unsetenv... yes
checking for unsetenv() return type... int
checking whether unsetenv obeys POSIX... guessing yes
checking for a traditional french locale... (cached) none
checking for a french Unicode locale... (cached) none
checking for a traditional japanese locale... (cached) none
checking for a transitional chinese locale... (cached) none
checking whether wctob works... guessing yes
checking whether wctob is declared... yes
checking whether an open file can be renamed... guessing no
checking if changeword is wanted... no
checking which shell to use for syscmd... /bin/sh
checking if malloc debugging is wanted... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating lib/Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating checks/Makefile
config.status: creating examples/Makefile
config.status: creating lib/config.h
config.status: linking source_subfolder/GNUmakefile to GNUmakefile
config.status: executing depfiles commands
config.status: executing stamp-h commands
make  all-recursive
make[1]: Entering directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2'
Making all in .
make[2]: Entering directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2'
Making all in examples
make[2]: Entering directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/examples'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/examples'
Making all in lib
make[2]: Entering directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/lib'
  GEN      alloca.h
  GEN      configmake.h
  GEN      c++defs.h
  GEN      arg-nonnull.h
  GEN      warn-on-use.h
  GEN      limits.h
  GEN      unused-parameter.h
  GEN      getopt.h
  GEN      sys/types.h
  GEN      langinfo.h
  GEN      fcntl.h
  GEN      signal.h
  GEN      math.h
  GEN      spawn.h
  GEN      locale.h
  GEN      stdio.h
  GEN      stdlib.h
  GEN      string.h
  GEN      sys/stat.h
  GEN      sys/time.h
  GEN      sys/wait.h
  GEN      time.h
  GEN      unistd.h
  GEN      wctype.h
  GEN      wchar.h
make  all-am
make[3]: Entering directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/lib'
  CC       gl_avltree_oset.o
  CC       c-ctype.o
  CC       c-stack.o
  CC       binary-io.o
  CC       c-strncasecmp.o
  CC       c-strcasecmp.o
  CC       clean-temp.o
  CC       cloexec.o
clangclang: warning: clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
: warning: clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       closein.o
  CC       dirname.o
  CC       close-stream.o
  CC       closeout.o
  CC       basename.o
  CC       dirname-lgpl.o
clangclangclang: : : warning: warning: warningargument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]: 

argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clangclang: : warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       basename-lgpl.o
  CC       stripslash.o
  CC       execute.o
  CC       exitfail.o
  CC       fatal-signal.o
  CC       fd-hook.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       fd-safer-flag.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       dup-safer-flag.o
  CC       filenamecat.o
  CC       filenamecat-lgpl.o
  CC       fopen-safer.o
  CC       freading.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       getprogname.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       hard-locale.o
  CC       gl_linkedhash_list.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       gl_list.o
  CC       localcharset.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       malloca.o
  CC       math.o
  CC       memchr2.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       gl_oset.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       pipe2.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       pipe2-safer.o
  CC       printf-frexp.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       printf-frexpl.o
  CC       progname.o
  CC       quotearg.o
  CC       sig-handler.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       spawn-pipe.o
  CC       mkstemp-safer.o
  CC       tempname.o
  CC       glthread/threadlib.o
  CC       glthread/tls.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       tmpdir.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       unistd.o
  CC       dup-safer.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       fd-safer.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       pipe-safer.o
  CC       verror.o
  CC       version-etc.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       version-etc-fsf.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       wait-process.o
  CC       wctype-h.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       xmalloc.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       xalloc-die.o
  CC       gl_xlist.o
  CC       xmalloca.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       gl_xoset.o
  CC       xprintf.o
  CC       xsize.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       xstrndup.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang  CC       xvasprintf.o
: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       xasprintf.o
  CC       asnprintf.o
  CC       fclose.o
  CC       fcntl.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       fflush.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clangclang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       fpurge.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       freadahead.o
  CC       fseek.o
  CC       fseeko.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       getopt1.o
  CC       getopt.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       isnanf.o
  CC       isnanl.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       mbrtowc.o
clangclang: : warningwarning: : argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]

  CC       memchr.o
  CC       obstack.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       printf-args.o
  CC       printf-parse.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       regex.o
  CC       strstr.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       vasnprintf.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
../source_subfolder/lib/obstack.c:clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
351:31: warning: incompatible function pointer types initializing 'void (*)(void) __attribute__((noreturn))' with an expression of type 'void (void)' [-Wincompatible-function-pointer-types]
__attribute_noreturn__ void (*obstack_alloc_failed_handler) (void)
                              ^
  GEN      charset.alias
  GEN      ref-add.sed
  GEN      ref-del.sed
  CC       glthread/lock.o
1 warning generated.
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  AR       libm4.a
make[3]: Leaving directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/lib'
make[2]: Leaving directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/lib'
Making all in src
make[2]: Entering directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/src'
  CC       m4.o
  CC       builtin.o
  CC       debug.o
  CC       eval.o
  CC       freeze.o
  CC       input.o
  CC       format.o
  CC       macro.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clangclang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
: clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CC       output.o
  CC       path.o
  CC       symtab.o
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
  CCLD     m4
/usr/bin/ld: ../lib/libm4.a: error adding symbols: archive has no index; run ranlib to add one
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:1555: m4] Error 1
make[2]: Leaving directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/src'
make[1]: *** [Makefile:1572: all-recursive] Error 1
make[1]: Leaving directory '/home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2'
make: *** [Makefile:1528: all] Error 2
m4/1.4.18: 
m4/1.4.18: ERROR: Package '3386fb6a91a12a047a2d351791c92b1cd6efb4e2' build failed
m4/1.4.18: WARN: Build folder /home/user/.conan/data/m4/1.4.18/_/_/build/3386fb6a91a12a047a2d351791c92b1cd6efb4e2
ERROR: m4/1.4.18: Error in build() method, line 90
        autotools.make()
        ConanException: Error 2 while executing make -j8

Looks like conan detects arm-linux-gnueabihf-ld but autotools uses /usr/bin/ld instead of arm-linux-gnueabihf-ld

@xakod xakod added the bug Something isn't working label Aug 9, 2021
@madebr
Copy link
Contributor

madebr commented Aug 9, 2021

A verbose build would be nice.
Replace the following line:


with

        autotools.make(args=["V=1"])

Then we can see what invocation failed.

@xakod
Copy link
Contributor Author

xakod commented Aug 11, 2021

Verbose log is a bit longer so I attach file
log.txt

@madebr
Copy link
Contributor

madebr commented Aug 11, 2021

Can you please give a as much information about the toolchain you're using as you can?
How to get it? What operating system?

I think it's weird that CFLAGS (-target arm-linux-gnueabihf) is nowhere to be found in the compile commands. It contains -rtlib=compiler-rt, which is not understood by clang.

Can you try the following things, in sequence? And report back your findings.

  1. I think you are currently building with only passing a host profile (conan create . m4/1.4.18@ -pr:h arm_profile).
    Please build m4 with also passing a build profile:

    conan create . m4/1.4.18@ -pr:h arm_profile -pr:b default
    
  2. Checkout conan-center-index from m4: modernize recipe + don't add -rtlib=compiler-rt #6694 (get fetch origin pull/6694/head:pr_m4 && git reset --hard HEAD && git checkout pr_m4)
    Try the following command again;

    conan create . m4/1.4.18@ -pr:h arm_profile -pr:b default
    

If the last command fails, please patch the conanfile.py again to add V=1 and post the build log.
Posting the config.log in the build folder (that should be available in your conan cache (~/.conan/data/m4/1.4.18/_/_/build/<hash>/config.log) might also be useful.

@xakod
Copy link
Contributor Author

xakod commented Aug 11, 2021

Sorry, I fix link to my toolchain in first post (dockerfile)

I think it's weird that CFLAGS (-target arm-linux-gnueabihf) is nowhere to be found in the compile commands. It contains -rtlib=compiler-rt, which is not understood by clang.

Yep, it looks strange.
I'll try suggested things

@xakod
Copy link
Contributor Author

xakod commented Aug 11, 2021

@madebr I tried your suggestions, nothing changes. I attach logs with your pr
log.txt
config.log

@madebr
Copy link
Contributor

madebr commented Aug 11, 2021

The -rtlib=compiler-rt really does not make sense. I just grepped the m4 source for it and got 0 matches.
The conan sources also don't give a match.

Please tell me how to get your toolchain setup.
I would like to reproduce it.

@xakod
Copy link
Contributor Author

xakod commented Aug 11, 2021

@madebr Debian Buster, then

echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
apt update
apt install clang-11/buster-backports
ln -s /usr/bin/clang++-11 /usr/bin/clang++
ln -s /usr/bin/clang-11 /usr/bin/clang
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
dpkg --add-architecture armhf && apt update 
apt install -y build-essential  pkg-config binutils gcc-8-arm-linux-gnueabihf cross-config dpkg-cross
apt install -y libstdc++-8-dev:armhf  crossbuild-essential-armhf

And then you can use my profile from the first post.

@madebr
Copy link
Contributor

madebr commented Aug 11, 2021

Thanks for the detailed build instructions.
I could reproduce the error first-try on a debian docker image.

Looks like the -rtlib=compiler-rt came from the m4 recipe itself.
It does not make sense to put it in m4, so I removed it. (It belongs in a profile)
Please try #6694 again.

It fails now when linking m4:

/usr/bin/arm-linux-gnueabihf-ld: symtab.o: in function `symtab_init':
symtab.c:(.text+0x34): undefined reference to `__mulodi4'
/usr/bin/arm-linux-gnueabihf-ld: ../lib/libm4.a(clean-temp.o): in function `create_temp_dir':
clean-temp.c:(.text+0x9c): undefined reference to `__mulodi4'
/usr/bin/arm-linux-gnueabihf-ld: ../lib/libm4.a(fatal-signal.o): in function `at_fatal_signal':
fatal-signal.c:(.text+0x190): undefined reference to `__mulodi4'
/usr/bin/arm-linux-gnueabihf-ld: ../lib/libm4.a(xmalloc.o): in function `xnmalloc':
xmalloc.c:(.text+0x30): undefined reference to `__mulodi4'
/usr/bin/arm-linux-gnueabihf-ld: ../lib/libm4.a(xmalloc.o): in function `xnrealloc':
xmalloc.c:(.text+0xe4): undefined reference to `__mulodi4'
/usr/bin/arm-linux-gnueabihf-ld: ../lib/libm4.a(xmalloc.o):xmalloc.c:(.text+0x334): more undefined references to `__mulodi4' follow

Perhaps it is missing a linker flag?

@xakod
Copy link
Contributor Author

xakod commented Aug 11, 2021


Perhaps it is missing a linker flag?

It looks like a bug in clang because android/ndk#184 (comment) and https://bugs.webkit.org/attachment.cgi?id=351411&action=diff maybe we can try smth similar but I'm not familar with autotools

@madebr
Copy link
Contributor

madebr commented Aug 11, 2021

I think you need to pass the compiler runtime library (-rtlib=compiler-rt) when linking.
See https://clang.llvm.org/docs/CommandGuide/clang.html
So add LDFLAGS=-target arm-linux-gnueabihf -rtlib=compiler-rt to your profile.

The error then becomes:

configure:4757: /usr/bin/clang -O3 -target arm-linux-gnueabihf -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -target arm-linux-gnueabihf -rtlib=compiler-rt conftest.c  >&5
/usr/bin/arm-linux-gnueabihf-ld: cannot find /usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.builtins-armhf.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I don't know how to install /usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.builtins-armhf.a.
Perhaps you know?

@xakod

This comment has been minimized.

@madebr
Copy link
Contributor

madebr commented Aug 11, 2021

Is it safe to say that at this point, the m4 recipe is not at fault anymore?
This has become a toolchain problem?

@xakod
Copy link
Contributor Author

xakod commented Aug 11, 2021

I'm sure it's ok with native armhf compilation (only upstream CCI) but not your PR due to new commit 5222d9c (i think it should be reverted). Cross-compilation don't work as it was. I tried with libclang-common-11-dev:armhf but recipe fails too and libclang-common-11-dev:armhf : Conflicts: libclang-common-11-dev Maybe you have ideas what i do wrong

@madebr
Copy link
Contributor

madebr commented Aug 11, 2021

I don't think so.
7c5762b has 2 flaws:

  1. it replaces the CFLAGS, instead of appending
  2. it does something that belongs in the profile: choosing the compiler runtime library (https://clang.llvm.org/docs/CommandGuide/clang.html)

@madebr
Copy link
Contributor

madebr commented Aug 11, 2021

I've tested building #6694 with #6822 using armv7hf and armv8 and it works fine.
Though, its a GNU toolchain.

armv8 profile:

[settings]
os=Linux
arch=armv8
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
arm-toolchain/2021.07
[env]

armv7hf profile:

[settings]
os=Linux
arch=armv7hf
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
arm-toolchain/2021.07
[env]

I need a standalone LLVM arm toolchain..

@xakod
Copy link
Contributor Author

xakod commented Aug 13, 2021

@madebr how this #6822 toolchains work? Do you link m4 with compiler-rt or with lbgcc? I tried with libgcc but looks like libgcc does not contain __mulodi4. If we cannot link against libgcc we should force compiler-rt

@madebr
Copy link
Contributor

madebr commented Aug 13, 2021

#6822 is packaging a gcc compiler. -rtlib is an option unique to clang. So it does not apply.

-rtlib is something that belongs in a profile.
You need to add LDFLAGS=-rtlib=compiler-rt to the env section.

Your compiler toolchain does not even have compiler-rt, so forcing this is not okay.

@xakod
Copy link
Contributor Author

xakod commented Aug 13, 2021

-rtlib is an option unique to clang. So it does not apply.

But __mulodi4 is unique to libclang so you cannot compile m4 without libclang

Your compiler toolchain does not even have compiler-rt, so forcing this is not okay.

The main is problem is my toolchain has compiler-rt (but for x86_64). I have libclang-common-11-dev: amd64 with clang-11: amd64, meanwhile clang wanna libclang-common-11-dev: armhf (which contains libclang_rt.builtins-armhf.a) but libclang-common-11-dev : armhf conflicts with clang-11: amd64 ... It looks like a vicious circle because I have either compiler without rt or only rt without compiler (except gcc)

is packaging a gcc compiler

It can be packaged with gcc and libclang (no conflict here)

@madebr
Copy link
Contributor

madebr commented Aug 13, 2021

Have you got it working?
What changed since #6777 (comment)?

@xakod
Copy link
Contributor Author

xakod commented Aug 13, 2021

nothing, packages conflict

@madebr
Copy link
Contributor

madebr commented Aug 13, 2021

@planetmarshall
Can you give some context around 7c5762b?
It is causing problems for some toolchains.

@planetmarshall
Copy link
Contributor

planetmarshall commented Aug 15, 2021

@planetmarshall
Can you give some context around 7c5762b?
It is causing problems for some toolchains.

I don't recall exactly but think it was related to this - https://lists.llvm.org/pipermail/llvm-dev/2017-December/119635.html

More specifically, clang implicitly links to the compiler runtime provided by GNU or LLVM depending n the platform. Clang may handle this better since I submitted that PR - see also https://clang.llvm.org/docs/Toolchain.html#compiler-runtime

@planetmarshall
Copy link
Contributor

I think if you compile M4 with clang it generates some symbols which are only available in compiler-rt and not libgcc (I'm seeing some build failures now since #6694 - but I have no problem moving the flag to a profile). That being said - presumably CCI has clang builds of M4 available - are they built with -rtlib=compiler-rt?

@xakod
Copy link
Contributor Author

xakod commented Aug 16, 2021

There is no builds with clang on linux (and libstdc++) https://c3i.jfrog.io/c3i/misc/summary.html?json=https://c3i.jfrog.io/c3i/misc/logs/pr/6694/4-production/m4/1.4.18//summary.json
It's not a problem to move flag to profile (but there is no reason if m4 cannot be compiled with clang + libgcc).
I think the related debian packages conflict so I requested help from debian community

@madebr
Copy link
Contributor

madebr commented Aug 16, 2021

@planetmarshall
Do you have an idea why it's only m4 that would need -rtlib=compiler-rt?
And in what cases? Don't you see this problem with other packages as well?
m4 builds fine with my native system clang compiler.

It looks like c3i does not build m4 with clang: https://c3i.jfrog.io/c3i/misc/summary.html?json=https://c3i.jfrog.io/c3i/misc/logs/pr/6694/4-production/m4/1.4.18//summary.json
Only gcc@Linux, MSVC@Windows and apple-clang@Macos are tested.

@planetmarshall
Copy link
Contributor

@planetmarshall
Do you have an idea why it's only m4 that would need -rtlib=compiler-rt?
And in what cases? Don't you see this problem with other packages as well?
m4 builds fine with my native system clang compiler.

I think this is specific to the configuration used to build clang. It builds fine with the conan docker images that use the clang APT
packages provided by LLVM. I can reproduce the error in my local environment, but I use a clang compiled from source. (The apt clang emits argument unused by compilation warning when passed --rtlib whereas a clang built from source with default options does not.

I haven't examined the particular configuration used to build the APT packages - but maybe they have the missing symbols built into clang whereas the compiler built from source on my system does not (and the cross compiler appears to have a similar issue). Either way, it does seem to be a toolchain issue and not something specific to the conan recipe.

@planetmarshall
Copy link
Contributor

So the new conan docker images also build clang from source, and crucially include the following cmake flag - DCLANG_DEFAULT_RTLIB=compiler-rt - hence why the --rtlib flag is not required (or accepted)

See https://github.com/conan-io/conan-docker-tools/blob/master/modern/clang/Dockerfile for details.

@xakod
Copy link
Contributor Author

xakod commented Aug 17, 2021

#6694 failed to build with native clang (not only cross compilation) with default profile without --rtlib=compiler-rt

@madebr
Copy link
Contributor

madebr commented Aug 17, 2021

So it depends on the toolchain. Which belongs in the profile/conf.
I still don't understand how this problem would only affect m4.

@xakod
Copy link
Contributor Author

xakod commented Aug 17, 2021

Yep, it depends on toolchain. But after #6694 you cannot build m4 on armhf with default profile for clang. Look at spack spack/spack#10280, they force flag --rtlib=compiler-rt for clang (I don't understand why m4 can be build with gcc+libgcc but not with clang+libgcc)

@macdew
Copy link

macdew commented Sep 15, 2021

I'm sorry to report that following #6694 the m4 recipe doesn't work for me anymore either. Failing to build using clang on Ubuntu 20.04. My clang/llvm comes from the standard apt-get package clang-10 so not using a custom build.

Like everyone else, the issue here is the removal of the --rtlib=compiler-rt flag, which causes the following link error trying to build m4:

/usr/bin/ld: ../lib/libm4.a(xmalloc.o): in function `xnrealloc':
xmalloc.c:(.text+0xb8): undefined reference to `__muloti4'
/usr/bin/ld: ../lib/libm4.a(xmalloc.o):xmalloc.c:(.text+0x2cd): more undefined references to `__muloti4' follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)

As for why it works in gcc but not clang, my understanding is that the code generated by gcc has the required function built in, but clang includes the method only in the compiler-rt library. By removing that library, the offending instruction can no longer be resolved by the linker.

@Kaylx
Copy link

Kaylx commented Sep 16, 2021

I am also seeing the same undefined references to __muloti4 linker issue as mentioned above since #6694 was submitted.
Based on the original 7c5762b submit I forked the recipe and made the following change within _configure_autotools:

        elif self._is_clang:
            # workaround undefined references to `__muloti4' issue
            self._autotools.link_flags.append("-rtlib=compiler-rt")

I know the suggestion is to use a profile but this way was less disruption for all involved.

@madebr
Copy link
Contributor

madebr commented Sep 18, 2021

I"m open to add -rtlib=compiler-rt, but I don't know how to reproduce it.
Can somebody provide a docker image?

@macdew
Copy link

macdew commented Sep 21, 2021

Sorry I can't help with a docker image, but as mentioned, in my case it's Ubuntu 20.04 with the standard distro clang package, ie apt-get install clang

I feel that this combo should definitely be supported and made working. The suggestion by @Kaylx looks good to me, I have tried that change and it does allow the recipe to build correctly for me too.

@madebr
Copy link
Contributor

madebr commented Sep 21, 2021

Thanks @macdew
The stock clang from ubuntu 20.04 indeed failed to build m4.
I think I fixed it in #7369

1.4.19 does not need this fix, because the underlying problem has been fixed by gnulib.

@xakod
Copy link
Contributor Author

xakod commented Oct 30, 2021

Current recipe with 1.4.19 can be build correctly (with profile from first post) without any hacks from profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants