Debugging glibc build process - gcc

I am am trying to install glibc on Clear Linux, and am having difficulty debugging (or even which of the many makefiles to debug).
My previous attempts are in these two threads:
How do I build into a specified directory using the "prefix" option of configure?
Errors building glibc: what is wrong with the make/confgure files?
So now my problem is that when I run make, the build stops with:
-I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/x86_64 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/x86_64/64 -I../sysdeps/x86_64/fpu/multiarch -I../sysdeps/x86_64/fpu -I../sysdeps/x86/fpu/include -I../sysdeps/x86/fpu -I../sysdeps/x86_64/multiarch -I../sysdeps/x86_64 -I../sysdeps/x86 -I../sysdeps/ieee754/float128 -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64/wordsize-64 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -D_LIBC_REENTRANT -include /home/james/Downloads/glibc-build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DTOP_NAMESPACE=glibc -I../soft-fp -o /home/james/Downloads/glibc-build/math/s_modfl.o -MD -MP -MF /home/james/Downloads/glibc-build/math/s_modfl.o.dt -MT /home/james/Downloads/glibc-build/math/s_modfl.o
cc1: error: -fassociative-math disabled; other options take precedence [-Werror]
cc1: all warnings being treated as errors
make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:791: /home/james/Downloads/glibc-build/math/s_modfl.o] Error 1
make[2]: Leaving directory '/home/james/Downloads/glibc/math'
make[1]: *** [Makefile:215: math/subdir_lib] Error 2
make[1]: Leaving directory '/home/james/Downloads/glibc'
make: *** [Makefile:9: all] Error 2
I suspect a clue might be in this thread, but it's a little over my head.
associative-math with GCC
I'm also guessing that the later errors from the makefiles are the result of whatever went wrong with associative math.
Edit
As requested, I ran
james#clr ~/Downloads/glibc-build $ make -j
and this was the end of the output
-I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64/wordsize-64 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -D_LIBC_REENTRANT -include /home/james/Downloads/glibc-build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DPIC -DSHARED -DTOP_NAMESPACE=glibc -I../soft-fp -DASSEMBLER -g -Werror=undef -Wa,--noexecstack -o /home/james/Downloads/glibc-build/math/s_signbit.os -MD -MP -MF /home/james/Downloads/glibc-build/math/s_signbit.os.dt -MT /home/james/Downloads/glibc-build/math/s_signbit.os
cc1: all warnings being treated as errors
make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:791: /home/james/Downloads/glibc-build/math/s_modfl.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:825: /home/james/Downloads/glibc-build/math/s_modf.o] Error 1
cc1: all warnings being treated as errors
make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:893: /home/james/Downloads/glibc-build/math/s_modff.o] Error 1
cc1: all warnings being treated as errors
make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:757: /home/james/Downloads/glibc-build/math/s_modff128.o] Error 1
cc1: all warnings being treated as errors
make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:807: /home/james/Downloads/glibc-build/math/s_modfl.os] Error 1
cc1: all warnings being treated as errors
make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:841: /home/james/Downloads/glibc-build/math/s_modf.os] Error 1
make[2]: Leaving directory '/home/james/Downloads/glibc/math'
make[1]: *** [Makefile:215: math/subdir_lib] Error 2
make[1]: Leaving directory '/home/james/Downloads/glibc'
make: *** [Makefile:9: all] Error 2
edit 2: more information in response to comments by Basile:
I need glibc to run some modules for Phoronix Test Suite, and in the future I will probably need it to build libraries for R. As far as I can tell, it is not included with Clear Linux (at least PTS doesn't think I have it installed), and I do not see it among the list of available bundles.
Versions:
james#clr ~/Downloads $ uname -r
4.17.1-582.native
james#clr ~/Downloads $ gcc --version
gcc (Clear Linux OS for Intel Architecture) 8.1.1 20180514
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Configure commands
james#clr ~/Downloads $ git clone git://sourceware.org/git/glibc.git
james#clr ~/Downloads $ cd glibc
james#clr ~/Downloads/glibc $ git checkout --track -b local_glibc-2.27 origin/release/2.27/master
Branch 'local_glibc-2.27' set up to track remote branch 'release/2.27/master' from 'origin'.
Switched to a new branch 'local_glibc-2.27'
james#clr ~/Downloads/glibc $ mkdir /home/james/Downloads/glibc-build/
james#clr ~/Downloads/glibc $ cd /home/james/Downloads/glibc-build/
james#clr ~/Downloads/glibc-build $ ~/Downloads/glibc/configure --prefix=/home/james/Downloads/glibc-build
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for readelf... readelf
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ can link programs... yes
checking for sysdeps preconfigure fragments... aarch64 alpha arm hppa i386 m68k microblaze mips nios2 powerpc riscv s390 sh sparc tile x86_64 checking whether gcc compiles in -mx32 mode by default... no
checking for use of fpu sysdeps directories... yes
checking for -fstack-protector... yes
checking for -fstack-protector-strong... yes
checking for -fstack-protector-all... yes
checking for assembler and linker STT_GNU_IFUNC support... yes
checking for gcc attribute ifunc support... yes
checking if compiler warns about alias for function with incompatible types... yes
checking sysdep dirs... sysdeps/unix/sysv/linux/x86_64/64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86 sysdeps/x86/nptl sysdeps/unix/sysv/linux/wordsize-64 sysdeps/x86_64/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/x86_64 sysdeps/unix sysdeps/posix sysdeps/x86_64/64 sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86/fpu sysdeps/x86_64/multiarch sysdeps/x86_64 sysdeps/x86 sysdeps/ieee754/float128 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/wordsize-64 sysdeps/ieee754 sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether as is GNU as... yes
checking whether ld is GNU ld... yes
checking for as... as
checking version of as... 2.30, ok
checking for ld... ld
checking version of ld... 2.30, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 4.2.1, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.19.8.1, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 6.5, ok
checking for sed... sed
checking version of sed... 4.5, ok
checking for gawk... gawk
checking version of gawk... 4.2.1, ok
checking for bison... bison
checking version of bison... 3.0.5, ok
checking if gcc is sufficient to build libc... yes
checking for nm... gcc-nm
checking for python3... python3
checking LD_LIBRARY_PATH variable... ok
checking for bash... /usr/bin/bash
checking for perl... /usr/bin/perl
checking for install-info... /usr/bin/install-info
checking for .set assembler directive... yes
checking linker support for protected data symbol... yes
checking linker support for INSERT in linker script... yes
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking whether to use .ctors/.dtors header and trailer... no
checking for libunwind-support in compiler... no
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for linker that supports -z execstack... yes
checking for linker that supports --no-dynamic-linker... yes
checking for -static-pie... yes
checking for -fpie... yes
checking for --hash-style option... yes
checking for sufficient default -shared layout... no
checking for GLOB_DAT reloc... yes
checking linker output format... elf64-x86-64
checking for -fno-toplevel-reorder -fno-section-anchors... yes
checking for -mtls-dialect=gnu2... yes
checking whether cc puts quotes around section names... no
checking for __builtin_memset... no
checking for redirection of built-in functions... yes
checking for compiler option to disable generation of FMA instructions... -ffp-contract=off
checking if gcc accepts -fno-tree-loop-distribute-patterns with __attribute__ ((__optimize__))... yes
checking for libgd... yes
checking for is_selinux_enabled in -lselinux... no
checking for _FORTIFY_SOURCE predefine... yes
checking whether the linker provides working __ehdr_start... yes
checking for __builtin_trap with no external dependencies... yes
checking whether the C++ compiler supports thread_local... yes
running configure fragment for sysdeps/unix/sysv/linux/x86_64/64
running configure fragment for sysdeps/unix/sysv/linux/x86_64
running configure fragment for sysdeps/unix/sysv/linux
checking installed Linux kernel header files... 3.2.0 or later
checking for kernel header at least 3.2.0... ok
checking for symlinks in /home/james/Downloads/glibc-build/include... ok
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/unix/inet
running configure fragment for sysdeps/x86_64
checking for AVX512DQ support in assembler... yes
checking for AVX512 support... yes
checking for Intel MPX support... yes
checking whether -fPIC is default... no
checking whether -fPIE is default... no
configure: creating ./config.status
config.status: creating config.make
config.status: creating Makefile
config.status: creating config.h
config.status: executing default commands
Edit 3: The FULL output of make was too long to include, so I put it on pastebin:
https://pastebin.com/H3yGC5aj

The compiler command line you posed contains these flags:
-fassociative-math -fasynchronous-unwind-tables -feliminate-unused-debug-types -fexceptions -ffat-lto-objects -fmerge-all-constants -fno-semantic-interposition -fno-signed-zeros -fno-stack-protector -fno-trapping-math -frounding-math -fstack-protector -ftree-loop-distribute-patterns
However, -fassociative-math is one of the unsafe math optimizations, and glibc cannot be built with them because with such optimizations, the math library would produce wrong results—and as you found out, some of the required compiler flags for parts of the math library are even incompatible with them.
You did not pass these flags to configure or make explicitly, so it is most likely they come from the CFLAGS environment variable. You need to unset that before calling configure and make.

Related

Error after .configure to install Omnet++ 5.6.1 on Mac

I am trying to get Omnet++ to run on my Mac and i am at the following step:
3.6. Configuring and Building OMNeT++
Check configure.user to make sure it contains the settings you need. In most cases
you don’t need to change anything in it.
In the top-level OMNeT++ directory, type:
$ ./configure
The configure script detects installed software and configuration of your system.
It writes the results into the Makefile.inc file, which will be read by the makefiles
during the build process.
But my log shows me this and i don't understand what i did wrong or where i should make changes:
checking build system type... x86_64-apple-darwin21.1.0
checking host system type... x86_64-apple-darwin21.1.0
configure: -----------------------------------------------
configure: reading configure.user for your custom settings
configure: -----------------------------------------------
checking for icc... no
checking for gcc... 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... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for icpc... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for g++... g++
checking for ranlib... ranlib
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
checking whether g++ supports -fno-omit-frame-pointer... yes
checking whether g++ supports -Wl,--no-as-needed... no
checking whether g++ supports -Wl,--as-needed... no
checking if shared libs need -fPIC... no
checking for dlopen with CFLAGS="" LIBS=""... yes
checking if --export-dynamic linker option is supported/needed... test failed
checking for flags needed to link with static libs containing simple modules... -all_load
configure: NOTE: Use the following syntax when linking with static libraries
configure: containing simple modules and other dynamically registered components:
configure: g++ ... -Wl,-all_load <libs> ...
checking whether linker supports -rpath... yes
checking for bison... bison -y
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... none needed
checking whether yytext is a pointer... no
checking for make... make
checking for perl... perl
checking for swig... not found
checking for math with CFLAGS="" LIBS=""... yes
checking for standard C++ lib with CFLAGS="" LIBS="-lstdc++"... yes
checking for dlopen with CFLAGS="" LIBS=""... yes
checking for qmake... no
checking for qmake-qt5... no
checking for qmake5... no
configure: error: Qtenv cannot find qmake -- maybe it is not in the PATH or has some exotic name (tested names were: qmake qmake-qt5 qmake5) - disabling Qtenv. You can try setting the QT_PATH variable in configure.user to a valid location.
Make sure you have sourced the setenv script with
source setenv
before trying to run the configure script.
Also, why not use OMNeT++ 5.7 ?

Whats the difference between calling "make" in eclipse and calling "make" in terminal?

I'm trying to build a makefile project in eclipse under windows but the build fails (Project > Build Project). However, if I navigate to the build directory in the msys2 terminal and call "make" everything runs just fine.
To figure out why building in eclipse does not work I am now trying to find the difference between using make in terminal and in eclipse.
Up to the point where the build fails the console output of eclipse is the same as the output in msys2 terminal:
This is the console output in eclipse:
make
Making all in i386-rtems5/c
make[1]: Entering directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c'
Making all in .
make[2]: Entering directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c'
Configuring RTEMS_BSP=pc686
checking for gmake... no
checking for make... make
checking build system type... x86_64-w64-mingw32
checking host system type... i386-pc-rtems5
checking rtems target cpu... i386
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i386-rtems5-strip... i386-rtems5-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for RTEMS_BSP... pc686
checking whether CPU supports libposix... yes
configure: setting up make/custom
configure: creating make/pc686.cache
make[3]: Entering directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686'
make[3]: Leaving directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686'
checking for RTEMS_CPU_MODEL...
checking for RTEMS_BSP_FAMILY... pc386
checking for CPU_CFLAGS... (cached) -mtune=pentiumpro -march=pentium
checking for CFLAGS_OPTIMIZE_V... (cached) -O2 -g -ffunction-sections -fdata-sections
checking for style of include used by make... GNU
checking for i386-rtems5-gcc... i386-rtems5-gcc
checking for i386-rtems5-gcc... (cached) i386-rtems5-gcc
checking whether the C compiler works... no
configure: error: in `/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[2]: *** [Makefile:731: pc686] Error 1
make[2]: Leaving directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c'
make[1]: *** [Makefile:289: all-recursive] Error 1
make[1]: Leaving directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c'
make: *** [Makefile:410: all-recursive] Error 1
"make" terminated with exit code 2. Build might be incomplete.
This is the output in the msys2 terminal:
$ make
Making all in i386-rtems5/c
make[1]: Verzeichnis „/c/rt5/rtems/kernel/pc/i386-rtems5/c“ wird betreten
Making all in .
make[2]: Verzeichnis „/c/rt5/rtems/kernel/pc/i386-rtems5/c“ wird betreten
Configuring RTEMS_BSP=pc686
configure: loading site script /mingw64/etc/config.site
checking for gmake... no
checking for make... make
checking build system type... x86_64-w64-mingw32
checking host system type... i386-pc-rtems5
checking rtems target cpu... i386
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i386-rtems5-strip... i386-rtems5-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for RTEMS_BSP... pc686
checking whether CPU supports libposix... yes
configure: setting up make/custom
configure: creating make/pc686.cache
make[3]: Entering directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686'
make[3]: Leaving directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686'
checking for RTEMS_CPU_MODEL...
checking for RTEMS_BSP_FAMILY... pc386
checking for CPU_CFLAGS... (cached) -mtune=pentiumpro -march=pentium
checking for CFLAGS_OPTIMIZE_V... (cached) -O2 -g -ffunction-sections -fdata-sections
checking for style of include used by make... GNU
checking for i386-rtems5-gcc... i386-rtems5-gcc
checking for i386-rtems5-gcc... (cached) i386-rtems5-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
[...]
As far as I can see in both cases make is called but with different results. The Makefile is also the same in both cases.
What could cause this?
The difference between invoking make in eclipse and in msys2 terminal is that it is run in different environments. To ensure that I get the same result with both methods I had to make sure that my windows PATH contained the right entries. To find out what entries I had to add to PATH i examined the config.log for the failing case as well as for the successful case.
Additionally I had to run eclipse as administrator as it had no privileges to create temporary files.

1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed

I have php 7.3.4 installed on my macbook pro and I am trying to enable a php extension which composer requires (intl). I have enabled the extension intl in php.ini, to which I received an error message saying it can not be found - so I'm assuming this means I need to install it. I found a tutorial online on how to install the extensions (link at bottom), and I followed this.
At the stage where when I run sudo pecl install intl, I receive an error;
make: *** [php_intl.lo] Error 1
ERROR: `make' failed
Does anyone have a solution?
Jamess-MBP:~ work$ sudo pecl install intl
Password: .........
PHP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/lib/php/pecl/20180731/intl (dlopen(/usr/local/lib/php/pecl/20180731/intl, 9): image not found), /usr/local/lib/php/pecl/20180731/intl.so (dlopen(/usr/local/lib/php/pecl/20180731/intl.so, 9): image not found)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/lib/php/pecl/20180731/intl (dlopen(/usr/local/lib/php/pecl/20180731/intl, 9): image not found), /usr/local/lib/php/pecl/20180731/intl.so (dlopen(/usr/local/lib/php/pecl/20180731/intl.so, 9): image not found)) in Unknown on line 0
downloading intl-3.0.0.tgz ...
Starting to download intl-3.0.0.tgz (248,200 bytes)
....................................................done: 248,200 bytes
150 source files, building
running: phpize
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
Specify where ICU libraries and headers can be found [DEFAULT] : /usr/local/Cellar/icu4c/63.1/
building in /private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0
running: /private/tmp/pear/temp/intl/configure --with-php-config=/usr/local/Cellar/php/7.3.4/bin/php-config --with-icu-dir=/usr/local/Cellar/icu4c/63.1/
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
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... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin17.7.0
checking host system type... x86_64-apple-darwin17.7.0
checking target system type... x86_64-apple-darwin17.7.0
checking for PHP prefix... /usr/local/Cellar/php/7.3.4
checking for PHP includes... -I/usr/local/Cellar/php/7.3.4/include/php -I/usr/local/Cellar/php/7.3.4/include/php/main -I/usr/local/Cellar/php/7.3.4/include/php/TSRM -I/usr/local/Cellar/php/7.3.4/include/php/Zend -I/usr/local/Cellar/php/7.3.4/include/php/ext -I/usr/local/Cellar/php/7.3.4/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php/7.3.4/pecl/20180731
checking for PHP installed headers prefix... /usr/local/Cellar/php/7.3.4/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable internationalization support... yes, shared
checking for location of ICU headers and libraries... checking for pkg-config... /usr/local/bin/pkg-config
/usr/local/Cellar/icu4c/63.1
checking for ICU 4.0 or greater... found 63.1
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin17.7.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin17.7.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/libtool --mode=compile cc -I/usr/local/Cellar/icu4c/63.1/include -Wno-write-strings -I. -I/private/tmp/pear/temp/intl -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/include -I/private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/main -I/private/tmp/pear/temp/intl -I/usr/local/Cellar/php/7.3.4/include/php -I/usr/local/Cellar/php/7.3.4/include/php/main -I/usr/local/Cellar/php/7.3.4/include/php/TSRM -I/usr/local/Cellar/php/7.3.4/include/php/Zend -I/usr/local/Cellar/php/7.3.4/include/php/ext -I/usr/local/Cellar/php/7.3.4/include/php/ext/date/lib -I/usr/local/Cellar/icu4c/63.1/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/intl/php_intl.c -o php_intl.lo
mkdir .libs
cc -I/usr/local/Cellar/icu4c/63.1/include -Wno-write-strings -I. -I/private/tmp/pear/temp/intl -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/include -I/private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/main -I/private/tmp/pear/temp/intl -I/usr/local/Cellar/php/7.3.4/include/php -I/usr/local/Cellar/php/7.3.4/include/php/main -I/usr/local/Cellar/php/7.3.4/include/php/TSRM -I/usr/local/Cellar/php/7.3.4/include/php/Zend -I/usr/local/Cellar/php/7.3.4/include/php/ext -I/usr/local/Cellar/php/7.3.4/include/php/ext/date/lib -I/usr/local/Cellar/icu4c/63.1/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/intl/php_intl.c -fno-common -DPIC -o .libs/php_intl.o
In file included from /private/tmp/pear/temp/intl/php_intl.c:25:
In file included from /private/tmp/pear/temp/intl/php_intl.h:34:
/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error: 'ext/standard/php_smart_str.h' file not found
#include <ext/standard/php_smart_str.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: `make' failed
I followed an online tutorial to get to this stage, this was http://budiirawan.com/install-php-intl-extension-os-x/
Please follow the process (from https://medium.com/#agaetis/solved-install-intl-php-extension-for-xampp-and-magento-for-macos-mojave-41fa42336fc6)
Steps to install intl.so: correct intl ships with PHP source, not available in PECL.
Make sure Xcode and autoconf is installed
Download PHP version used in XAMPP from php.net and run series of command
tar -xzvf php-7.3.10.tar.gz; cd php-7.3.10/ext/intl
/Applications/XAMPP/bin/phpize
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
make
sudo make install
add below line in php.ini (/Applications/XAMPP/xamppfiles/etc/php.ini)
extension=intl.so
I’ve solved this myself by installing the extension with macports rather than pecl.

i want to install Tesseract and ./configure

this is the result from ./configue:
checking for g++... g++
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... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
Using git revision: 4.00.00alpha-358-g362b68e
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
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 for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of g++... gcc3
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
./configure: line 4250: syntax error near unexpected token `-mavx,'
./configure: line 4250: `AX_CHECK_COMPILE_FLAG(-mavx, avx=true, avx=false)'
this is the error that i get after running make:
make: *** No targets specified and no makefile found. Stop.
thus sudo make install doesnt work either
I was getting the same error. Below is what worked for me.
cd tesseract-3.05.00
./autogen.sh
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
make install
ldconfig
See below link for full script, that includes installing Leptonica and dependencies properly.
https://github.com/EisenVault/install-tesseract-redhat-centos/blob/master/install-tesseract.sh
If configure fails with errors like these, then double check you have installed autoconf-archive and restart Tesseract installation process (./autogen.sh,./configure` ...)
And make sure that you have installed the latest version of laptonica, in my case it was Laptonica-1.74, as it is required for the installation process.
Reference to tesseract-ocr compiling

libtool: link: unsupported hardcode properties - Blank CXX Configuration

Error
I'm receiving the following error when I try execute make for a autotools based project on OS X:
libtool: link: unsupported hardcode properties
libtool: link: See the libtool documentation for more information.
libtool: link: Fatal configuration error.
make calls libtool as follows:
/bin/sh ./libtool --tag=CXX --mode=link clang++ -g <blah blah blah>
Investigation
I've narrowed the problem down specifically to the use of the CXX tag. For some reason the libtool script (generated by running ./configure and hence libtoolize etc.) spits out a CXX configuration as follows:
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# The linker used to build libraries.
LD=""
# How to create reloadable object files.
reload_flag=""
reload_cmds=""
# Commands used to build an old-style archive.
old_archive_cmds=""
# A language specific compiler.
CC=""
# Is the compiler the GNU compiler?
with_gcc=
# Compiler flag to turn off builtin functions.
no_builtin_flag=""
# Additional compiler flags for building library objects.
pic_flag=""
# How to pass a linker flag through the compiler.
wl=""
# Compiler flag to prevent dynamic linking.
link_static_flag=""
# Does compiler simultaneously support -c and -o options?
compiler_c_o=""
# Whether or not to add -lc for building shared libraries.
build_libtool_need_lc=
# Whether or not to disallow shared libs when runtime libs are static.
allow_libtool_libs_with_static_runtimes=
# Compiler flag to allow reflexive dlopens.
export_dynamic_flag_spec=""
# Compiler flag to generate shared objects directly from archives.
whole_archive_flag_spec=""
# Whether the compiler copes with passing no objects directly.
compiler_needs_object=""
# Create an old-style archive from a shared archive.
old_archive_from_new_cmds=""
# Create a temporary old-style archive to link instead of a shared archive.
old_archive_from_expsyms_cmds=""
# Commands used to build a shared archive.
archive_cmds=""
archive_expsym_cmds=""
# Commands used to build a loadable module if different from building
# a shared archive.
module_cmds=""
module_expsym_cmds=""
# Whether we are building with GNU ld or not.
with_gnu_ld=""
# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag=""
# Flag that enforces no undefined symbols.
no_undefined_flag=""
# Flag to hardcode $libdir into a binary during linking.
# This must work even if $libdir does not exist
hardcode_libdir_flag_spec=""
# Whether we need a single "-rpath" flag with a separated argument.
hardcode_libdir_separator=""
# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
# DIR into the resulting binary.
hardcode_direct=
# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
# library is relocated.
hardcode_direct_absolute=
# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
# into the resulting binary.
hardcode_minus_L=
# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
# into the resulting binary.
hardcode_shlibpath_var=
# Set to "yes" if building a shared library automatically hardcodes DIR
# into the library and all subsequent libraries and executables linked
# against it.
hardcode_automatic=
# Set to yes if linker adds runtime paths of dependent libraries
# to runtime path list.
inherit_rpath=
# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=
# Set to "yes" if exported symbols are required.
always_export_symbols=
# The commands to list exported symbols.
export_symbols_cmds=""
# Symbols that should not be listed in the preloaded symbols.
exclude_expsyms=""
# Symbols that must always be exported.
include_expsyms=""
# Commands necessary for linking programs (against libraries) with templates.
prelink_cmds=""
# Commands necessary for finishing linking programs.
postlink_cmds=""
# Specify filename containing input files.
file_list_spec=""
# How to hardcode a shared library path into an executable.
hardcode_action=
# The directories searched by this compiler when creating a shared library.
compiler_lib_search_dirs=""
# Dependencies to place before and after the objects being linked to
# create a shared library.
predep_objects=""
postdep_objects=""
predeps=""
postdeps=""
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=""
# ### END LIBTOOL TAG CONFIG: CXX
As you can see, everything is blank. So the libtool script freaks out, and rightly so. So my confusion lies in how the libtool script ended up including this bogus CXX configuration.
The CC configuration is fine. Simply calling the libtool script with --tag=CC is actually enough to get my project linking just fine. However, that's obviously not correct; you should simply be able to execute:
./configure
make
./configure output
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for DEPS... yes
checking for udevadm... no
checking build system type... x86_64-apple-darwin12.3.0
checking host system type... x86_64-apple-darwin12.3.0
checking target system type... x86_64-apple-darwin12.3.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... 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... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin12.3.0 file names to x86_64-apple-darwin12.3.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin12.3.0 file names to toolchain format... func_convert_file_noop
checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver #FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... gcc -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 for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin12.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking operating system... Darwin/MacOS X
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking dependency style of clang++... gcc3
checking whether byte ordering is bigendian... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Setup details
libtool version: 2.4.2
libtool revision: 1.3337
autoconf version: GNU Autoconf 2.69
clang++ version: Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
This was caused by AC_PROG_LIBTOOL (since deprecated in favour of LT_INIT) appearing before AC_PROG_CXX([clang++]) in configure.ac.
Strangely enough the LT_INIT/LT_LANG documentation actually shows LT_INIT appearing before AC_PROG_CXX, so I'm not entirely sure why this turned out to be a problem.

Resources