Bug 1168420

Summary: meson:test fails with -fno-common
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Liška <martin.liska>
Component: BasesystemAssignee: Dominique Leuenberger <dimstar>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P3 - Medium    
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
See Also: https://github.com/mesonbuild/meson/issues/7017
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1160244    

Description Martin Liška 2020-04-02 09:21:34 UTC
Fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:N/meson:test/standard/x86_64

with:
[  193s] FAILED: versionprinter 
[  193s] cc  -o versionprinter 'versionprinter@exe/meson-generated_.._version.c.o' 'versionprinter@exe/main.c.o' -Wl,--as-needed -Wl,--no-undefined
[  193s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: versionprinter@exe/main.c.o:/home/abuild/rpmbuild/BUILD/meson-0.53.2/b 580bf11c4c/../test cases/common/68 build always/version.h:3: multiple definition of `version_string'; versionprinter@exe/meson-generated_.._version.c.o:/home/abuild/rpmbuild/BUILD/meson-0.53.2/b 580bf11c4c/../test cases/common/68 build always/version.h:3: first defined here
[  193s] collect2: error: ld returned 1 exit status
[  193s] ninja: build stopped: subcommand failed.

Please take a look at the META issue for the instructions.
Comment 1 Martin Liška 2020-04-21 07:27:52 UTC
With the updates meson I now see for meson:test:

[  257s] Sanity check compile stderr:
[  257s] 
[  257s] -----
[  257s] Running test binary command: /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/sanitycheckcpp.exe
[  257s] C++ compiler for the host machine: c++ (gcc 10.0.1 "c++ (SUSE Linux) 10.0.1 20200417 (experimental) [revision b835645c7a51b7e99092abe61d677aa491836f95]")
[  257s] C++ linker for the host machine: c++ ld.bfd 2.34.0.20200325-3
[  257s] Adding test "OpenMP C++"
[  257s] test cases/common/189 openmp/meson.build:41: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build.
[  257s] None of 'FC' are defined in the environment, not changing global flags.
[  257s] None of 'FFLAGS' are defined in the environment, not changing global flags.
[  257s] None of 'LDFLAGS' are defined in the environment, not changing global flags.
[  257s] None of 'FC_LD' are defined in the environment, not changing global flags.
[  257s] None of 'F_LD' are defined in the environment, not changing global flags.
[  257s] Fortran compiler for the build machine: gfortran (gcc 10.0.1 "GNU Fortran (SUSE Linux) 10.0.1 20200417 (experimental) [revision b835645c7a51b7e99092abe61d677aa491836f95]")
[  257s] Fortran linker for the build machine: gfortran ld.bfd 2.34.0.20200325-3
[  257s] None of 'FC' are defined in the environment, not changing global flags.
[  257s] None of 'FFLAGS' are defined in the environment, not changing global flags.
[  257s] None of 'LDFLAGS' are defined in the environment, not changing global flags.
[  257s] None of 'FC_LD' are defined in the environment, not changing global flags.
[  257s] None of 'F_LD' are defined in the environment, not changing global flags.
[  257s] Fortran compiler for the host machine: gfortran (gcc 10.0.1 "GNU Fortran (SUSE Linux) 10.0.1 20200417 (experimental) [revision b835645c7a51b7e99092abe61d677aa491836f95]")
[  257s] Fortran linker for the host machine: gfortran ld.bfd 2.34.0.20200325-3
[  257s] Adding test "OpenMP Fortran"
[  257s] Running compile:
[  257s] Working directory:  /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpzszdgbtv
[  257s] Command line:  gfortran /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpzszdgbtv/testfile.f90 -pipe -cpp -E -P -D_FILE_OFFSET_BITS=64 -cpp -P -O0 -fopenmp 
[  257s] 
[  257s] Code:
[  257s]  
[  257s]         
[  257s]         #ifndef _OPENMP
[  257s]         # define _OPENMP
[  257s]         #endif
[  257s]         "MESON_GET_DEFINE_DELIMITER"
[  257s] _OPENMP
[  257s] Compiler stdout:
[  257s]  
[  257s] 
[  257s] 
[  257s]         
[  257s]         #ifndef 201511
[  257s]         # define 201511
[  257s]         #endif
[  257s]         "MESON_GET_DEFINE_DELIMITER"
[  257s] 201511
[  257s] 
[  257s] Compiler stderr:
[  257s]  
[  257s] Running compile:
[  257s] Working directory:  /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpawvtatn3
[  257s] Command line:  gfortran /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpawvtatn3/testfile.f90 -pipe -cpp -E -P -D_FILE_OFFSET_BITS=64 -cpp -P -O0 
[  257s] 
[  257s] Code:
[  257s]  
[  257s]         #ifdef __has_include
[  257s]          #if !__has_include("omp.h")
[  257s]           #error "Header 'omp.h' could not be found"
[  257s]          #endif
[  257s]         #else
[  257s]          #include <omp.h>
[  257s]         #endif
[  257s] Compiler stdout:
[  257s]  
[  257s] 
[  257s] 
[  257s]         #ifdef 0
[  257s]          #if !0("omp.h")
[  257s]           #error "Header 'omp.h' could not be found"
[  257s]          #endif
[  257s]         #else
[  257s]          #include <omp.h>
[  257s]         #endif
[  257s] 
[  257s] Compiler stderr:
[  257s]  /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpawvtatn3/testfile.f90:2:0:
[  257s] 
[  257s]     2 |         #ifdef __has_include
[  257s]       | 
[  257s] Error: "__has_include" used outside of preprocessing directive
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpawvtatn3/testfile.f90:2:0: Error: missing '(' before "__has_include" operand
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpawvtatn3/testfile.f90:2:0: Error: operator "__has_include" requires a header-name
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpawvtatn3/testfile.f90:3:0:
[  257s] 
[  257s]     3 |          #if !__has_include("omp.h")
[  257s]       | 
[  257s] Error: "__has_include" used outside of preprocessing directive
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpawvtatn3/testfile.f90:3:0: Error: missing '(' before "__has_include" operand
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpawvtatn3/testfile.f90:3:0: Error: operator "__has_include" requires a header-name
[  257s] 
[  257s] Running compile:
[  257s] Working directory:  /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpclv4d6x8
[  257s] Command line:  gfortran /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpclv4d6x8/testfile.f90 -pipe -cpp -E -P -D_FILE_OFFSET_BITS=64 -cpp -P -O0 
[  257s] 
[  257s] Code:
[  257s]  
[  257s]         #ifdef __has_include
[  257s]          #if !__has_include("omp_lib.h")
[  257s]           #error "Header 'omp_lib.h' could not be found"
[  257s]          #endif
[  257s]         #else
[  257s]          #include <omp_lib.h>
[  257s]         #endif
[  257s] Compiler stdout:
[  257s]  
[  257s] 
[  257s] 
[  257s]         #ifdef 0
[  257s]          #if !0("omp_lib.h")
[  257s]           #error "Header 'omp_lib.h' could not be found"
[  257s]          #endif
[  257s]         #else
[  257s]          #include <omp_lib.h>
[  257s]         #endif
[  257s] 
[  257s] Compiler stderr:
[  257s]  /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpclv4d6x8/testfile.f90:2:0:
[  257s] 
[  257s]     2 |         #ifdef __has_include
[  257s]       | 
[  257s] Error: "__has_include" used outside of preprocessing directive
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpclv4d6x8/testfile.f90:2:0: Error: missing '(' before "__has_include" operand
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpclv4d6x8/testfile.f90:2:0: Error: operator "__has_include" requires a header-name
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpclv4d6x8/testfile.f90:3:0:
[  257s] 
[  257s]     3 |          #if !__has_include("omp_lib.h")
[  257s]       | 
[  257s] Error: "__has_include" used outside of preprocessing directive
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpclv4d6x8/testfile.f90:3:0: Error: missing '(' before "__has_include" operand
[  257s] /home/abuild/rpmbuild/BUILD/meson-0.54.0/b 536484cc32/meson-private/tmpclv4d6x8/testfile.f90:3:0: Error: operator "__has_include" requires a header-name
[  257s] 
[  257s] WARNING: OpenMP found but omp.h missing.
[  257s] Run-time dependency OpenMP for fortran found: NO 
[  257s] 
[  257s] test cases/common/189 openmp/meson.build:49:4: ERROR: Dependency "openmp" not found
[  257s]  
[  257s] 
[  257s]  
[  257s] 
[  261s] error: Bad exit status from /var/tmp/rpm-tmp.cVAFSI (%check)
[  261s] 
[  261s] 
[  261s] RPM build errors:
[  261s]     Bad exit status from /var/tmp/rpm-tmp.cVAFSI (%check)
[  261s] 
[  261s] marxinbox.suse.cz failed "build meson.spec" at Tue Apr 21 07:25:27 UTC 2020.

@Dimstar: Can you please take a look?
Comment 2 Martin Liška 2020-05-05 08:25:42 UTC
@Dimstar: Can you please exclude the test-case for now?
Comment 3 Martin Liška 2020-05-14 13:36:38 UTC
Fixed in devel project.