Opened 8 years ago

Closed 7 years ago

#53565 closed defect (invalid)

cmake: Fortran build error with MACOSX_DEPLOYMENT_TARGET set

Reported by: tenomoto (Takeshi Enomoto) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: cmake gcc5 gcc6

Description

When MACOSX_DEPLOYMENT_TARGET is set, gfortran fails to build a simple test program during cmake. The attachment is a minimal CMakeLists.txt to reproduce the problem. I used gfrotran-mp-6 on Sierra, but I also had the same problem with gfortran-mp-5.

$ tail CMakeFiles/CMakeError.log 
/opt/local/bin/gfortran-mp-6    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.11   -c /tmp/cmake/build/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_7967f.dir/testFortranCompiler.f.o
Linking Fortran executable cmTC_7967f
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7967f.dir/link.txt --verbose=1
/opt/local/bin/gfortran-mp-6       -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.11 CMakeFiles/cmTC_7967f.dir/testFortranCompiler.f.o  -o cmTC_7967f 
ld: unexpected token: !tapi-tbd-v2 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/lib/libSystem.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [cmTC_7967f] Error 1
make: *** [cmTC_7967f/fast] Error 2

Attachments (1)

CMakeLists.txt (75 bytes) - added by tenomoto (Takeshi Enomoto) 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by tenomoto (Takeshi Enomoto)

Attachment: CMakeLists.txt added

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Port: gcc5 gcc6 added; gcc removed

comment:2 Changed 7 years ago by tenomoto (Takeshi Enomoto)

Resolution: invalid
Status: newclosed

A workaround is to unset macosx_deployment_target. See #54472 and [386d7e7ff8cf5bc1c89e12389bb2e81dfe0d015b/macports-ports].

Note: See TracTickets for help on using tickets.