Opened 6 years ago

Closed 6 years ago

#57092 closed defect (fixed)

wxgtk-3.0: build fails on 10.12 (shared-ld: unhandled option '-stdlib=libc++')

Reported by: jwhowse4 Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: wxgtk-3.0

Description (last modified by mojca (Mojca Miklavec))

On MacOS 10.12.6 with XCode 9.2, the build for wxgtk-3.0 fails with the errors in the attacked log file.

/path/to/wxgtk-3.0/work/wxWidgets-3.0.4/build/shared-ld-sh -bundle -headerpad_max_install_names -o webkit2_extu30.bundle webkit2_ext_webview_webkit2_extension.o  -L/opt/macports/lib -Wl,-headerpad_max_install_names -stdlib=libc++ -arch x86_64  -L/opt/macports/lib  -framework IOKit -framework CoreServices -framework System -framework ApplicationServices   -L/opt/macports/lib -lwebkit2gtk-4.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -ljavascriptcoregtk-4.0 -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation -lz -lpthread -liconv
:info:build shared-ld: unhandled option '-stdlib=libc++'

Any suggestions for a fix?

Attachments (2)

wxgtk-3.0_main.log (3.1 MB) - added by jwhowse4 6 years ago.
build log
patch-wxgtk-3.0-build-shared-ld-sh-handle-libxx.diff (343 bytes) - added by kencu (Ken) 6 years ago.

Change History (9)

Changed 6 years ago by jwhowse4

Attachment: wxgtk-3.0_main.log added

build log

comment:1 Changed 6 years ago by mojca (Mojca Miklavec)

Cc: mojca@… removed
Description: modified (diff)
Owner: set to mojca
Status: newassigned
Summary: wxgtk-3.0 build fails on 10.12wxgtk-3.0: build fails on 10.12 (shared-ld: unhandled option '-stdlib=libc++')
Version: 2.5.3

comment:2 Changed 6 years ago by mojca (Mojca Miklavec)

I did not manage to reproduce this at the moment, but here are some difference. This is what I get (10.13):

checking for WEBKIT... configure: WARNING: webkit2gtk not found, falling back to webkitgtk
checking for WEBKIT... configure: WARNING: webkitgtk not found.
configure: WARNING: WebKit not available, disabling wxWebView

and this is what's in your log:

checking for WEBKIT... yes

I believe the difference comes from one of the webkit-gtk ports being installed or not. This needs fixing in any case, but it would be nice to figure out the source of the problem as well.

comment:3 Changed 6 years ago by kencu (Ken)

I get the same error, building it on 10.6.8 configured with libc++:

CXX="/opt/local/bin/clang++-mp-3.9" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_wxWidgets-3.0/wxgtk-3.0/work/wxWidgets-3.0.4/build/shared-ld-sh -bundle -headerpad_max_install_names -o webkit2_extu30.bundle webkit2_ext_webview_webkit2_extension.o  -L/opt/local/lib -Wl,-headerpad_max_install_names -stdlib=libc++ -arch x86_64  -L/opt/local/lib  -framework IOKit -framework CoreServices -framework System -framework ApplicationServices   -L/opt/local/lib -lwebkit2gtk-4.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lsoup-2.4 -lgio-2.0 -ljavascriptcoregtk-4.0 -lgobject-2.0 -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation -lz -lpthread -liconv
shared-ld: unhandled option '-stdlib=libc++'
make: *** [webkit2_extu30.bundle] Error 1

the script that errors out is this one:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_wxWidgets-3.0/wxgtk-3.0/work/wxWidgets-3.0.4/build/shared-ld-sh

and in that script, the -stdlib=libc++ option is not handled. I added some script manually to handle that flag like this:

       -stdlib*)
        # collect these options
        args="${args} $1"
        ;;

and then it worked fine, and the port installed.

The trick is how to patch that functionality into the port so it doesn't need to be done manually. It would be easy enough to generate a patch, and then manually add that patch with a system call in the portfile.

Ideally, we'd figure out how to add it to the configure.in script (where I believe this is generated).

THAT is not so easy for me...

comment:4 Changed 6 years ago by kencu (Ken)

Here's the patch (you can't add it as a patchfile, I believe, because all patching comes before the configure stage... you'd have to run patch manually with a system command post-configure.

--- build/shared-ld-sh.orig	2018-09-03 14:59:03.000000000 -0700
+++ build/shared-ld-sh	2018-09-03 14:59:12.000000000 -0700
@@ -46,6 +46,11 @@
         args="${args} $1"
         ;;
 
+       -stdlib*)
+        # collect these options
+        args="${args} $1"
+        ;;
+
        -dynamiclib|-bundle)
         linking_flag="$1"
         ;;

Changed 6 years ago by kencu (Ken)

comment:5 in reply to:  2 ; Changed 6 years ago by jwhowse4

Replying to mojca:

I did not manage to reproduce this at the moment, but here are some difference. This is what I get (10.13):

checking for WEBKIT... configure: WARNING: webkit2gtk not found, falling back to webkitgtk
checking for WEBKIT... configure: WARNING: webkitgtk not found.
configure: WARNING: WebKit not available, disabling wxWebView

and this is what's in your log:

checking for WEBKIT... yes

I believe the difference comes from one of the webkit-gtk ports being installed or not. This needs fixing in any case, but it would be nice to figure out the source of the problem as well.

I have the webkit2-gtk port installed. When I deactivate it, wxgtk-3.0 builds without error. Thanks for the suggestion.

comment:6 in reply to:  5 Changed 6 years ago by mojca (Mojca Miklavec)

Replying to jwhowse4:

I have the webkit2-gtk port installed. When I deactivate it, wxgtk-3.0 builds without error. Thanks for the suggestion.

Thanks a lot for confirmation. We have two unrelated bugs. The first fix has been suggested by Ken (to avoid the break in your case; I would patch configure itself though). The second bug is on our side, that's opportunistic usage of webkit2-gtk. We should figure out if this dependency is needed/useful and either make sure that it's not used, or make it a dependency of the build. I have no clue myselfy, but apparently no other user missed it so far, so maybe we can simply disable it?

PR is at https://github.com/macports/macports-ports/pull/2513

Last edited 6 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:7 Changed 6 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: assignedclosed

In 49a46bcbfbf9e0283721fec5728530a562413a60/macports-ports (master):

wxgtk-3.0: accept '-stdlib=' option

Closes: #57092

Note: See TracTickets for help on using tickets.