Opened 4 weeks ago

Closed 2 weeks ago

#70724 closed defect (fixed)

clang-11-boostrap +debug: The C compiler is not able to compile a simple test program

Reported by: TheLastLovemark Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: Cc: catap (Kirill A. Korinsky)
Port: clang-11-bootstrap

Description

The most recent instances occurred when trying to port upgrade --enforce-variants gdal to include the +debug variant as well as port upgrade --enforce-variants llvm-17 +debug +tests

Attachments (3)

clang-11-bootstrap_during gdal upgrade +debug-main.log (73.0 KB) - added by TheLastLovemark 4 weeks ago.
clang-11-bootstrap-CMakeError.log (3.6 KB) - added by TheLastLovemark 4 weeks ago.
clang-11-bootstrap-CMakeOutput.log (1.3 KB) - added by TheLastLovemark 4 weeks ago.

Download all attachments as: .zip

Change History (10)

Changed 4 weeks ago by TheLastLovemark

comment:1 Changed 4 weeks ago by ryandesign (Ryan Carsten Schmidt)

:info:configure See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_clang-11-bootstrap/clang-11-bootstrap/work/build-x86_64/CMakeFiles/CMakeOutput.log".
:info:configure See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_clang-11-bootstrap/clang-11-bootstrap/work/build-x86_64/CMakeFiles/CMakeError.log".

Can you attach these files as well?

comment:2 Changed 4 weeks ago by TheLastLovemark

I already cleaned, so these will not be the same as if I was trying to invoke port upgrade --enforce-variants gdal +debug.

The best I can give you is port install clang-11-bootstrap +debug.

Changed 4 weeks ago by TheLastLovemark

Changed 4 weeks ago by TheLastLovemark

comment:3 Changed 3 weeks ago by TheLastLovemark

Am I cutoff?

comment:4 Changed 2 weeks ago by TheLastLovemark

any advice?

comment:5 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

Cc: catap removed
Owner: set to catap
Status: newassigned
Summary: clang-11-boostrap fails configuration when attempting to install ports with +debug variantclang-11-boostrap +debug:

The error in CMakeError.log is:

gcc: error: unrecognized command-line option '-fno-limit-debug-info'

So something is asking the compiler to use the flag -fno-limit-debug-info and your compiler doesn't understand that flag which is causing the feature tests that cmake runs to fail.

It is the cmake 1.1 portgroup that adds this flag but only when the compiler is clang:

https://github.com/macports/macports-ports/blob/728e4fbfe243c54733b8beeaa00940fb148bcf7b/_resources/port1.0/group/cmake-1.1.tcl#L496-L501

According to your main.log the clang-11-bootstrap port does have configure.compiler set to clang:

:debug:configure Using compiler 'Xcode Clang'

However however it overrides configure.cc and configure.cxx and points them to a specific version of GCC (from the gcc10-bootstrap port):

:debug:configure CC='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_clang-11-bootstrap/clang-11-bootstrap/work/bins/gcc'
:debug:configure CXX='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_clang-11-bootstrap/clang-11-bootstrap/work/bins/g++'

and the cmake 1.1 portgroup's decision is based on configure.cc and configure.cxx so the cmake 1.1 portgroup should not have added the -fno-limit-debug-info flag. The reason why it did is that it checks whether the entire value of configure.cc or configure.cxx contains the string "clang", and indeed here it does (within the port name "clang-11-bootstrap"). The cmake 1.1 portgroup should be fixed so that it only checks the last path component not the entire value.

comment:6 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

Cc: catap added
Owner: changed from catap to ryandesign
Status: assignedaccepted
Summary: clang-11-boostrap +debug:clang-11-boostrap +debug: The C compiler is not able to compile a simple test program

comment:7 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In a69f475c8f10a886fec1c440a280fdb0cc11362a/macports-ports (master):

cmake-1.1: Fix detection of clang in debug variant

Closes: #70724

Note: See TracTickets for help on using tickets.