Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#66246 closed defect (fixed)

-stdlib= flag added by compilers PG breaks builds with GCC on PPC

Reported by: barracuda156 Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: Cc: cjones051073 (Chris Jones)
Port:

Description

Trying to build my own port, OpenCoarrays, and it fails at configure; I cannot figure out where this comes from:

    gcc-mp-12: error: unrecognized command-line option '-stdlib=libc++'
    make[1]: *** [cmTC_d357f] Error 1
    make: *** [cmTC_d357f/fast] Error 2

Cmake cache has:

CMAKE_EXE_LINKER_FLAGS:STRING=-L/opt/local/lib -Wl,-headerpad_max_install_names -latomic -stdlib=libc++ -Wl,-rpath,/opt/local/lib/libgcc

But it is defined neither in the source nor in portfile (at least I cannot find anything relevant). I tried cutting out every mention of this flag in compilers PG and mpi PG, to no avail.

(This flag, likely, should not be forced at all, but definitely not on PPC.)

Change History (10)

comment:1 Changed 2 years ago by barracuda156

UPD. Okay, I found a fix, adding this works: configure.cxx_stdlib (set to empty).

But the question remains, where the unsupported flag creeps out from (unsupported on PPC, both de facto and in the existing portfile).

comment:2 Changed 2 years ago by kencu (Ken)

you mentioned you are using the compilers PG, so probably from this recent commit then:

https://github.com/macports/macports-ports/commit/6c7e20407ccc5f48c8a89b6cfef7561fea0002b0

comment:3 in reply to:  2 Changed 2 years ago by barracuda156

Replying to kencu:

you mentioned you are using the compilers PG, so probably from this recent commit then:

https://github.com/macports/macports-ports/commit/6c7e20407ccc5f48c8a89b6cfef7561fea0002b0

Thank you for the reference. I think I have tried removing that section altogether while looking to fix the build, but I will verify again. Given that no one tested libcxx with GCC, it is probably wise to keep that flag out of default options even on Intel.

  1. S. TBH I am not sure how compilers PG works. I thought it is silently used by Macports in general (directly or via proxy of other PGs).

UPD. Yes, it is definitely recent compilers PG breaking the build.

Last edited 2 years ago by barracuda156 (previous) (diff)

comment:4 Changed 2 years ago by jmroot (Joshua Root)

Cc: cjones051073 added

comment:5 Changed 2 years ago by barracuda156

Summary: Help needed: something forces -stdlib= flag which breaks build with GCC-stdlib= flag added by compilers PG breaks builds with GCC on PPC

comment:6 Changed 2 years ago by cjones051073 (Chris Jones)

The principle of setting stdlib correctly with gcc is not the problem. The issue is the compilers PG was not taking into account the fact this option is not available on PPC.

https://github.com/macports/macports-ports/commit/b82f938ab16e0ca63baa90f3adbb0732fc9dbd20

comment:7 Changed 2 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: assignedclosed

comment:8 in reply to:  6 Changed 2 years ago by barracuda156

Replying to cjones051073:

The principle of setting stdlib correctly with gcc is not the problem. The issue is the compilers PG was not taking into account the fact this option is not available on PPC.

https://github.com/macports/macports-ports/commit/b82f938ab16e0ca63baa90f3adbb0732fc9dbd20

Thank you!

  1. S. We can hopefully enable it later, once libcxx is fixed for PPC. But that gonna take some time, plus will need a thorough testing once it is fixed.

comment:9 Changed 2 years ago by cjones051073 (Chris Jones)

b.t.w. this discussion has made me realise the support in base for this also might need to handle PPC differently..

https://github.com/macports/macports-base/commit/ebd226139d5ba8389367606761658ad0e3bb5cce

Note: See TracTickets for help on using tickets.