procenv icon indicating copy to clipboard operation
procenv copied to clipboard

Check for `-flto` support prior to using it: compiler may not support it

Open barracuda156 opened this issue 5 months ago • 0 comments

Describe the bug -flto is used unconditionally, but may not be supported by a compiler.

To Reproduce Run the build on 10.4–10.6.

Expected behavior Configure should check for support of -flto and only use it when it is actually supported.

Desktop (please complete the following information):

  • OS: macOS 10.6
--->  Extracting procenv-0.60.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_procenv/procenv/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/procenv/procenv-0.60.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Configuring procenv
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_procenv/procenv/work/procenv-0.60" && autoreconf -fvi 
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: /opt/local/bin/aclocal --force -I m4
/opt/local/share/aclocal/zthread.m4:34: warning: underquoted definition of AM_PATH_ZTHREAD
/opt/local/share/aclocal/zthread.m4:34:   run info Automake 'Extending aclocal'
/opt/local/share/aclocal/zthread.m4:34:   or see https://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /opt/local/bin/autoconf --force
configure.ac:17: warning: The macro 'AC_GNU_SOURCE' is obsolete.
configure.ac:17: You should run autoupdate.
./lib/autoconf/specific.m4:489: AC_GNU_SOURCE is expanded from...
configure.ac:17: the top level
configure.ac:212: warning: AC_OUTPUT should be used without arguments.
configure.ac:212: You should run autoupdate.
autoreconf: running: /opt/local/bin/autoheader --force
autoreconf: running: /opt/local/bin/automake --add-missing --copy --force-missing
autoreconf: Leaving directory '.'
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_procenv/procenv/work/procenv-0.60" && ./configure --prefix=/opt/local --disable-silent-rules --enable-reproducible-build 
checking for gcc... ccache /usr/bin/gcc-4.2
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 the compiler supports GNU C... yes
checking whether ccache /usr/bin/gcc-4.2 accepts -g... yes
checking for ccache /usr/bin/gcc-4.2 option to enable C11 features... unsupported
checking for ccache /usr/bin/gcc-4.2 option to enable C99 features... -std=gnu99
checking whether ccache /usr/bin/gcc-4.2 -std=gnu99 understands -c and -o together... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
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 ccache /usr/bin/gcc-4.2 -std=gnu99 option to enable large file support... none needed
checking build system type... powerpc-apple-darwin10.0.0d2
checking host system type... powerpc-apple-darwin10.0.0d2
checking target system type... powerpc-apple-darwin10.0.0d2
checking for gcc... (cached) ccache /usr/bin/gcc-4.2
checking whether the compiler supports GNU C... (cached) yes
checking whether ccache /usr/bin/gcc-4.2 accepts -g... (cached) yes
checking for ccache /usr/bin/gcc-4.2 option to enable C11 features... (cached) unsupported
checking for ccache /usr/bin/gcc-4.2 option to enable C99 features... (cached) -std=gnu99
checking whether ccache /usr/bin/gcc-4.2 -std=gnu99 understands -c and -o together... (cached) yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for pkg-config... /opt/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for check... no
checking for linux/securebits.h... no
checking for pthread.h... yes
checking for _Bool... yes
checking for stdbool.h that conforms to C99 or later... yes
checking for clock_gettime... yes
checking for getcwd... yes
checking for localtime_r... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strstr... yes
checking for sched_getcpu... no
checking for ttyname... yes
checking for getresuid... no
checking for getresgid... no
checking for cpuset_alloc... no
checking for library containing kvm_openfiles... none required
checking for library containing sysinfo... no
checking for library containing numa_available... no
checking for numa.h... no
checking for library containing cap_getmode... no
checking for sys/capability.h... no
checking for sys/capsicum.h... no
checking for library containing cap_init... no
checking for library containing pthread_create... none required
checking for library containing getpidcon... no
checking for selinux/selinux.h... no
checking for library containing aa_gettaskcon... no
checking for library containing clock_gettime... none required
checking for sys/apparmor.h... no
./configure: line 6228: https://github.com/jamesodhunt/procenv: No such file or directory
checking whether sleep supports fractional seconds... yes
checking filesystem timestamp resolution... 2
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking xargs -n works... yes
checking dependency style of ccache /usr/bin/gcc-4.2 -std=gnu99... gcc3
checking whether C compiler accepts -fstack-protector... yes
checking whether C compiler accepts -Wformat... yes
checking whether C compiler accepts -Wformat-security... yes
## ---------------------------------------------------------------------------------------------------------------------- ##
## checking that test './src/tests/show_compiler_details' runs (output an aide to debugging should procenv fail to build) ##
## ---------------------------------------------------------------------------------------------------------------------- ##
XXX:--------------------------------------------------
XXX: ./src/tests/show_compiler_details: preprocessor ('cpp') version

powerpc-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5621) (dot 3)
Copyright (C) 2007 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.


XXX:--------------------------------------------------
XXX: ./src/tests/show_compiler_details: compiler ('gcc') version

powerpc-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5621) (dot 3)
Copyright (C) 2007 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.


XXX:--------------------------------------------------
XXX: ./src/tests/show_compiler_details: linker ('ld') version

ld: unknown option: --version

XXX:--------------------------------------------------
XXX: ./src/tests/show_compiler_details: preprocessor ('cpp') search paths

Using built-in specs.
Target: powerpc-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5621.3~3/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1 --program-prefix= --host=powerpc-apple-darwin10 --target=powerpc-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5621) (dot 3)
ignoring nonexistent directory "/Developer/usr/bin/../lib/gcc/powerpc-apple-darwin10/4.2.1/../../../../powerpc-apple-darwin10/include"
ignoring nonexistent directory "/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../../powerpc-apple-darwin10/include"
ignoring duplicate directory "/usr/include"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
 /opt/local/include
 /opt/local/include/LegacySupport
 /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin10/4.2.1/include
 /usr/local/include
 /usr/lib/gcc/powerpc-apple-darwin10/4.2.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"

XXX:--------------------------------------------------
XXX: ./src/tests/show_compiler_details: preprocessor ('cpp') pre-defined symbols

#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __DEC64_DEN__ 0.000000000000001E-383DD
#define __VEC__ 10206
#define __CHAR_BIT__ 8
#define _ARCH_PPCGR 1
#define __WCHAR_MAX__ 2147483647
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __ALTIVEC__ 1
#define __FLT_EVAL_METHOD__ 0
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 1
#define __DEC64_MAX_EXP__ 384
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
#define __APPLE_CC__ 5621
#define __DEC32_EPSILON__ 1E-6DF
#define __byref __attribute__((__blocks__(byref)))
#define __block __attribute__((__blocks__(byref)))
#define __LDBL_MAX_EXP__ 1024
#define __SCHAR_MAX__ 127
#define __USER_LABEL_PREFIX__ _
#define __LDBL_HAS_INFINITY__ 1
#define __DEC64_MIN_EXP__ (-383)
#define __DBL_DIG__ 15
#define __FLT_EPSILON__ 1.19209290e-7F
#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
#define __DEC32_MAX__ 9.999999E96DF
#define __ppc__ 1
#define __strong 
#define __APPLE__ 1
#define __DECIMAL_DIG__ 33
#define __LDBL_HAS_QUIET_NAN__ 1
#define __DYNAMIC__ 1
#define __GNUC__ 4
#define __FLT_HAS_DENORM__ 1
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_HAS_INFINITY__ 1
#define __DEC32_MIN_EXP__ (-95)
#define OBJC_NEW_PROPERTIES 1
#define __LDBL_HAS_DENORM__ 1
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC32_MIN__ 1E-95DF
#define __weak 
#define __DBL_MAX_EXP__ 1024
#define __DEC128_EPSILON__ 1E-33DL
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __GXX_ABI_VERSION 1002
#define __FLT_MIN_EXP__ (-125)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DBL_HAS_QUIET_NAN__ 1
#define __pixel __attribute__((altivec(pixel__))) unsigned short
#define __REGISTER_PREFIX__ 
#define __DBL_HAS_DENORM__ 1
#define __NO_INLINE__ 1
#define __DEC_EVAL_METHOD__ 2
#define _ARCH_PPC 1
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "4.2.1 (Apple Inc. build 5621) (dot 3)"
#define __BIG_ENDIAN__ 1
#define __UINTMAX_TYPE__ long long unsigned int
#define __DEC128_MIN__ 1E-6143DL
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC128_MIN_EXP__ (-6143)
#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 1060
#define __SIZE_TYPE__ long unsigned int
#define __DEC32_DEN__ 0.000001E-95DF
#define __FLT_RADIX__ 2
#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
#define __NATURAL_ALIGNMENT__ 1
#define __DBL_MIN_10_EXP__ (-307)
#define __LDBL_DIG__ 31
#define __vector __attribute__((altivec(vector__)))
#define __FLT_HAS_QUIET_NAN__ 1
#define __bool __attribute__((altivec(bool__))) unsigned
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 2147483647L
#define __FLT_HAS_INFINITY__ 1
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_MANT_DIG__ 16
#define __DEC32_MAX_EXP__ 96
#define _BIG_ENDIAN 1
#define __DEC128_DEN__ 0.000000000000000000000000000000001E-6143DL
#define __LDBL_MANT_DIG__ 106
#define __CONSTANT_CFSTRINGS__ 1
#define __WCHAR_TYPE__ int
#define __pic__ 2
#define __FLT_DIG__ 6
#define __INT_MAX__ 2147483647
#define __LONG_DOUBLE_128__ 1
#define __FLT_MAX_EXP__ 128
#define __BLOCKS__ 1
#define __DBL_MANT_DIG__ 53
#define __DEC64_MIN__ 1E-383DD
#define __WINT_TYPE__ int
#define __STDC_HOSTED__ 1
#define __LDBL_MIN_EXP__ (-968)
#define __MACH__ 1
#define __SSP__ 1
#define __LDBL_MAX_10_EXP__ 308
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __INTMAX_MAX__ 9223372036854775807LL
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __PIC__ 2
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __INTMAX_TYPE__ long long int
#define __DEC128_MAX_EXP__ 6144
#define __GNUC_MINOR__ 2
#define __DEC32_MANT_DIG__ 7
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
#define __PTRDIFF_TYPE__ int
#define __DEC128_MANT_DIG__ 34
#define __LDBL_MIN_10_EXP__ (-291)
#define __POWERPC__ 1
#define __GNUC_GNU_INLINE__ 1

XXX:--------------------------------------------------
XXX: ./src/tests/show_compiler_details: compiler ('gcc') features

Using built-in specs.
Target: powerpc-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5621.3~3/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1 --program-prefix= --host=powerpc-apple-darwin10 --target=powerpc-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5621) (dot 3)

XXX:--------------------------------------------------
XXX: ./src/tests/show_compiler_details: compiler ('gcc') search paths

install: /usr/lib/gcc/powerpc-apple-darwin10/4.2.1/
programs: =/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/:/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/:/usr/libexec/gcc/powerpc-apple-darwin10/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/:/usr/lib/gcc/powerpc-apple-darwin10/:/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/:/usr/libexec/gcc/powerpc-apple-darwin10/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/:/usr/lib/gcc/powerpc-apple-darwin10/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../../powerpc-apple-darwin10/bin/powerpc-apple-darwin10/4.2.1/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../../powerpc-apple-darwin10/bin/
libraries: =/lib/powerpc-apple-darwin10/4.2.1/:/lib/:/usr/lib/powerpc-apple-darwin10/4.2.1/:/usr/lib/:/opt/local/lib/powerpc-apple-darwin10/4.2.1/:/opt/local/lib/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../../powerpc-apple-darwin10/lib/powerpc-apple-darwin10/4.2.1/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../../powerpc-apple-darwin10/lib/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../powerpc-apple-darwin10/4.2.1/:/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../

XXX:--------------------------------------------------
## ---------------------------------------------------------------- ##
## showing result of test './src/tests/show_compiler_details': pass ##
## ---------------------------------------------------------------- ##
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating procenv.spec
config.status: creating config.h
config.status: executing depfiles commands

    Configure settings for procenv version 0.60

    Build platform              : darwin
    Reproducible build          : yes
    Debug build                 : no
    Check unit test framework   : no

    Libraries:

    libapparmor                 : no
    libselinux                  : no
    libcap                      : no
    libnuma                     : no
    libpthread                  : yes
    libkvm                      : yes
    libsysinfo / sysinfo        : no
              
--->  Building procenv
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_procenv/procenv/work/procenv-0.60" && /usr/bin/make -j6 -w all 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_procenv/procenv/work/procenv-0.60'
/usr/bin/make  all-recursive
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_procenv/procenv/work/procenv-0.60'
Making all in src
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_procenv/procenv/work/procenv-0.60/src'
ccache /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I . -I ./platform -I ./platform/darwin -D PROCENV_PLATFORM_DARWIN          -isystem/opt/local/include/LegacySupport -I/opt/local/include -pedantic -std=gnu99 -Wall -Wunused -flto  -Werror -pipe -Os -arch ppc -fstack-protector -Wformat -Wformat-security -MT procenv-procenv.o -MD -MP -MF .deps/procenv-procenv.Tpo -c -o procenv-procenv.o `test -f 'procenv.c' || echo './'`procenv.c
ccache /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I . -I ./platform -I ./platform/darwin -D PROCENV_PLATFORM_DARWIN          -isystem/opt/local/include/LegacySupport -I/opt/local/include -pedantic -std=gnu99 -Wall -Wunused -flto  -Werror -pipe -Os -arch ppc -fstack-protector -Wformat -Wformat-security -MT procenv-pr_list.o -MD -MP -MF .deps/procenv-pr_list.Tpo -c -o procenv-pr_list.o `test -f 'pr_list.c' || echo './'`pr_list.c
ccache /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I . -I ./platform -I ./platform/darwin -D PROCENV_PLATFORM_DARWIN          -isystem/opt/local/include/LegacySupport -I/opt/local/include -pedantic -std=gnu99 -Wall -Wunused -flto  -Werror -pipe -Os -arch ppc -fstack-protector -Wformat -Wformat-security -MT procenv-pstring.o -MD -MP -MF .deps/procenv-pstring.Tpo -c -o procenv-pstring.o `test -f 'pstring.c' || echo './'`pstring.c
ccache /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I . -I ./platform -I ./platform/darwin -D PROCENV_PLATFORM_DARWIN          -isystem/opt/local/include/LegacySupport -I/opt/local/include -pedantic -std=gnu99 -Wall -Wunused -flto  -Werror -pipe -Os -arch ppc -fstack-protector -Wformat -Wformat-security -MT procenv-string-util.o -MD -MP -MF .deps/procenv-string-util.Tpo -c -o procenv-string-util.o `test -f 'string-util.c' || echo './'`string-util.c
ccache /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I . -I ./platform -I ./platform/darwin -D PROCENV_PLATFORM_DARWIN          -isystem/opt/local/include/LegacySupport -I/opt/local/include -pedantic -std=gnu99 -Wall -Wunused -flto  -Werror -pipe -Os -arch ppc -fstack-protector -Wformat -Wformat-security -MT procenv-output.o -MD -MP -MF .deps/procenv-output.Tpo -c -o procenv-output.o `test -f 'output.c' || echo './'`output.c
ccache /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I . -I ./platform -I ./platform/darwin -D PROCENV_PLATFORM_DARWIN          -isystem/opt/local/include/LegacySupport -I/opt/local/include -pedantic -std=gnu99 -Wall -Wunused -flto  -Werror -pipe -Os -arch ppc -fstack-protector -Wformat -Wformat-security -MT procenv-util.o -MD -MP -MF .deps/procenv-util.Tpo -c -o procenv-util.o `test -f 'util.c' || echo './'`util.c
cc1: error: unrecognized command line option "-flto"
make[2]: *** [procenv-pstring.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: error: unrecognized command line option "-flto"
make[2]: *** [procenv-pr_list.o] Error 1
cc1: error: unrecognized command line option "-flto"
make[2]: *** [procenv-output.o] Error 1
cc1: error: unrecognized command line option "-flto"
make[2]: *** [procenv-util.o] Error 1
cc1: error: unrecognized command line option "-flto"
make[2]: *** [procenv-procenv.o] Error 1
cc1: error: unrecognized command line option "-flto"
make[2]: *** [procenv-string-util.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_procenv/procenv/work/procenv-0.60/src'
make[1]: *** [all-recursive] Error 1

barracuda156 avatar Sep 26 '24 13:09 barracuda156