Opened 4 months ago

Last modified 4 months ago

#70480 new defect

brlaser fails to build with gcc, because it does not understand -weak_framework passed directly (-Wl,-weak_framework works fine)

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: tiger, leopard, snowleopard Cc:
Port: brlaser

Description (last modified by barracuda156)

https://github.com/pdewacht/brlaser/issues/214

Maybe Xcode gcc could take this, but the port requires C++11 now, so a newer gcc is used. And it fails:

[ 80%] Linking CXX executable rastertobrlaser
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/rastertobrlaser.dir/link.txt --verbose=ON
/opt/local/bin/g++-mp-14  -Wall -Wno-missing-braces -Wformat -D_FORTIFY_SOURCE=2 -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/rastertobrlaser.dir/src/main.cc.o CMakeFiles/rastertobrlaser.dir/src/job.cc.o CMakeFiles/rastertobrlaser.dir/src/line.cc.o CMakeFiles/rastertobrlaser.dir/src/debug.cc.o -o rastertobrlaser  -Wl,-rpath,/opt/local/lib -lcupsimage -lcups -weak_framework Kerberos -framework CoreFoundation -framework Security -lz -lpthread -lresolv -framework SystemConfiguration -framework CoreFoundation
g++-mp-14: error: unrecognized command-line option '-weak_framework'; did you mean '-framework'?
make[2]: *** [rastertobrlaser] Error 1

Flags originate from cups-config:

36-25% cups-config --image --libs
-lcupsimage -lcups -weak_framework Kerberos -framework CoreFoundation -framework Security -lz -lpthread -lresolv -framework SystemConfiguration -framework CoreFoundation

They are not set directly by the port itself. How to fix it neatly?

This works:

if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
    configure.args-append \
                -DCUPS_LIBS="-lcupsimage -lcups -Wl,-weak_framework Kerberos -framework CoreFoundation -framework Security -lz -lpthread -lresolv -framework SystemConfiguration -framework CoreFoundation"
}

But perhaps can be done in a better way?

Change History (2)

comment:1 Changed 4 months ago by barracuda156

Description: modified (diff)

comment:2 Changed 4 months ago by barracuda156

This actually may be a bug in GCC, I will bring it to upstream.

Version 0, edited 4 months ago by barracuda156 (next)
Note: See TracTickets for help on using tickets.