You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build with the following {C,CXX,FC,LD}FLAGS to optimize the build: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Link-Time Optimization is a massively global compiler optimization pass which is pretty handy for producing faster executables. It also has the interesting property that because the compiler does whole-program analysis using bytecode, it can save type information and perform error checks that it normally doesn’t have enough insight for. In particular, checking for ODR issues and checking function type signature mismatches.
Note that all the -Werror=* flags are used to help detect cases where the compiler tries to optimize by assuming UB cannot exist in the source code -- if it does exist, ordinarily the code would be miscompiled, and this says to make the miscompilation a fatal error.
I got this error:
make[1]: Entering directory '/var/tmp/portage/dev-libs/papi-7.1.0/work/papi-7.1.0/src/ftests'
x86_64-pc-linux-gnu-gfortran -I../testlib -I. -I.. -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -DPAPI_NUM_COMP=3 -ffixed-line-length-132 -O1 openmp.F ../testlib/libtestlib.a ../libpapi.a -o openmp -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -fopenmp
f951: Warning: command-line option ‘-Wformat=1’ is valid for C/C++/ObjC/ObjC++ but not for Fortran
f951: Warning: ‘-Werror=’ argument ‘-Werror=format-security’ is not valid for Fortran
f951: Warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for Fortran
f951: Warning: ‘-Werror=’ argument ‘-Werror=implicit-int’ is not valid for Fortran
f951: Warning: ‘-Werror=’ argument ‘-Werror=int-conversion’ is not valid for Fortran
f951: Warning: ‘-Werror=’ argument ‘-Werror=incompatible-pointer-types’ is not valid for Fortran
../testlib/ftests_util.F:276:132: error: type of ‘papif_get_hardware_info’ does not match original declaration [-Werror=lto-type-mismatch]
276 | . vstring, model, mstring, revision, mhz )
| ^
../papi_fwrappers.c:290:6: note: type mismatch in parameter 10
290 | PAPI_FCALL( papif_get_hardware_info, PAPIF_GET_HARDWARE_INFO, ( int *ncpu,
| ^
../papi_fwrappers.c:290:6: note: type ‘int’ should match type ‘long int’
../papi_fwrappers.c:290:6: note: ‘papif_get_hardware_info_’ was previously declared here
../papi_fwrappers.c:290:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../testlib/ftests_util.F:253:132: error: type of ‘papif_event_code_to_name’ does not match original declaration [-Werror=lto-type-mismatch]
253 | call PAPIf_event_code_to_name(codes(i),name,retval)
| ^
../papi_fwrappers.c:779:6: note: type mismatch in parameter 4
779 | PAPI_FCALL( papif_event_code_to_name, PAPIF_EVENT_CODE_TO_NAME,
| ^
../papi_fwrappers.c:779:6: note: type ‘int’ should match type ‘long int’
../papi_fwrappers.c:779:6: note: ‘papif_event_code_to_name_’ was previously declared here
../papi_fwrappers.c:779:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gfortran returned 1 exit status
compilation terminated.
/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile.recipies:44: openmp] Error 1
make[1]: Leaving directory '/var/tmp/portage/dev-libs/papi-7.1.0/work/papi-7.1.0/src/ftests'
... times a bunch of times, as a bunch of targets link with this exact issue.
I tried to build with the following {C,CXX,FC,LD}FLAGS to optimize the build:
-flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Link-Time Optimization is a massively global compiler optimization pass which is pretty handy for producing faster executables. It also has the interesting property that because the compiler does whole-program analysis using bytecode, it can save type information and perform error checks that it normally doesn’t have enough insight for. In particular, checking for ODR issues and checking function type signature mismatches.
Note that all the -Werror=* flags are used to help detect cases where the compiler tries to optimize by assuming UB cannot exist in the source code -- if it does exist, ordinarily the code would be miscompiled, and this says to make the miscompilation a fatal error.
I got this error:
... times a bunch of times, as a bunch of targets link with this exact issue.
Originally reported downstream: https://bugs.gentoo.org/855983
Full build log: build.log
The text was updated successfully, but these errors were encountered: