Bug 127059 - [GTK] Fails to link JavaScriptCore in OS X, missing symbols add_history and readline
Summary: [GTK] Fails to link JavaScriptCore in OS X, missing symbols add_history and r...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 126492
  Show dependency treegraph
 
Reported: 2014-01-15 12:27 PST by Jeremy Huddleston Sequoia
Modified: 2015-10-12 10:04 PDT (History)
8 users (show)

See Also:


Attachments
Patch (537 bytes, patch)
2014-10-03 00:36 PDT, Philip Chimento
no flags Details | Formatted Diff | Diff
Patch (642 bytes, patch)
2014-10-03 00:43 PDT, Philip Chimento
no flags Details | Formatted Diff | Diff
Patch for 2.4.x stable branch (1.23 KB, patch)
2014-10-06 13:00 PDT, Philip Chimento
no flags Details | Formatted Diff | Diff
Patch (1.28 KB, patch)
2015-01-03 12:17 PST, Philip Chimento
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Huddleston Sequoia 2014-01-15 12:27:43 PST
darwin/gtk2/x11, webkit-gtk-2.3.4 fails to link.  2.3.3 was ok:

libtool: link: /usr/bin/clang -arch x86_64 -ansi -fno-strict-aliasing -pipe -Os -ftemplate-depth=256 -arch x86_64 -pthread -std=c99 -Qunused-arguments -O2 -Wl,-headerpad_max_install_names -arch x86_64 -Wl,--no-demangle -o Programs/.libs/minidom Source/JavaScriptCore/API/tests/Programs_minidom-JSNode.o Source/JavaScriptCore/API/tests/Programs_minidom-JSNodeList.o Source/JavaScriptCore/API/tests/Programs_minidom-Node.o Source/JavaScriptCore/API/tests/Programs_minidom-NodeList.o Source/JavaScriptCore/API/tests/Programs_minidom-minidom.o  -L/opt/local/lib ./.libs/libjavascriptcoregtk-1.0.dylib -lz -lgmodule-2.0 -lgthread-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -licui18n -licuuc -licudata -lm -lpthread -lstdc++ -pthread
libtool: link: /usr/bin/clang++ -fno-strict-aliasing -fno-rtti -I/opt/local/include -pipe -Os -ftemplate-depth=256 -Wno-c++11-extensions -arch x86_64 -stdlib=libc++ -pthread -std=c++11 -Wno-c++11-compat -Qunused-arguments -O2 -Wl,-headerpad_max_install_names -arch x86_64 -Wl,--no-demangle -o Programs/.libs/jsc-1 Source/JavaScriptCore/Programs_jsc_1-jsc.o  -L/opt/local/lib ./.libs/libjavascriptcoregtk-1.0.dylib -lpthread -lz -lgmodule-2.0 -lgthread-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -licui18n -licuuc -licudata -pthread
Undefined symbols for architecture x86_64:
  "_add_history", referenced from:
      __Z7jscmainiPPc in Programs_jsc_1-jsc.o
  "_readline", referenced from:
      __Z7jscmainiPPc in Programs_jsc_1-jsc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Jeremy Huddleston Sequoia 2014-01-15 12:30:21 PST
You're missing a link against libedit.
Comment 2 Alberto Garcia 2014-01-23 12:18:23 PST
Ok, I see the problem, this was r161853.

It's probably enough with something like this in Source/JavaScriptCore/GNUmakefile.am

if OS_DARWIN
Programs_jsc_LDADD += -ledit
endif

Can you give it a try and upload the patch if it works?
Comment 3 Philip Chimento 2014-10-03 00:36:45 PDT
Created attachment 239185 [details]
Patch

Worked for me, with the addition of @WEBKITGTK_API_MAJOR_VERSION@. Here's the patch.
Comment 4 Philip Chimento 2014-10-03 00:43:43 PDT
Created attachment 239186 [details]
Patch
Comment 5 Philip Chimento 2014-10-03 00:49:49 PDT
I'm guessing the patch doesn't apply to trunk because trunk doesn't use automake anymore :-/

Can it be committed to the 2.4 stable branch though?
Comment 6 Philip Chimento 2014-10-06 13:00:16 PDT
Created attachment 239350 [details]
Patch for 2.4.x stable branch
Comment 7 Philip Chimento 2014-10-06 13:05:42 PDT
Here's an updated patch with changelog.
Comment 8 Philip Chimento 2014-11-05 22:06:49 PST
Would it be possible to get this reviewed for 2.4.8?
Comment 9 Alberto Garcia 2014-11-06 00:55:11 PST
I believe the patch is fine, I just added it to the list of changes
to merge for 2.4.8:

http://trac.webkit.org/wiki/WebKitGTK/2.4.x

Carlos will take care of it before the next release.

Isn't webkitgtk 2.6 affected by this problem?
Comment 10 Philip Chimento 2014-11-06 08:57:51 PST
(In reply to comment #9)
> I believe the patch is fine, I just added it to the list of changes
> to merge for 2.4.8:
> 
> http://trac.webkit.org/wiki/WebKitGTK/2.4.x
> 
> Carlos will take care of it before the next release.
> 
> Isn't webkitgtk 2.6 affected by this problem?

This only affects the Automake build system, I think, which is defunct in 2.6.
Comment 11 Philip Chimento 2015-01-02 20:11:16 PST
I was wrong; -ledit is also missing in cmake in 2.6. I'll add a patch for that as well.

Thanks for the review for 2.4.8, by the way.
Comment 12 Philip Chimento 2015-01-03 12:17:24 PST
Created attachment 243919 [details]
Patch
Comment 13 Philip Chimento 2015-01-04 09:10:18 PST
Anyone know why -ledit would fail the "mac" EWS build? Do I need to check for PORT=GTK as well?
Comment 14 Carlos Garcia Campos 2015-01-05 02:13:16 PST
Comment on attachment 239350 [details]
Patch for 2.4.x stable branch

Committed to 2.4 branch, thanks. <http://trac.webkit.org/changeset/177899>
Comment 15 Carlos Garcia Campos 2015-01-05 02:15:14 PST
(In reply to comment #9)
> I believe the patch is fine, I just added it to the list of changes
> to merge for 2.4.8:
> 
> http://trac.webkit.org/wiki/WebKitGTK/2.4.x
> 
> Carlos will take care of it before the next release.
> 
> Isn't webkitgtk 2.6 affected by this problem?

Do we even support building wk2 in MAC OSX?
Comment 16 Philip Chimento 2015-01-05 12:18:40 PST
I don't know if you support it as such, but I have recently succeeded in building WebKitGTK 2.6.4 on OSX and would like to contribute all the fixes that I made.
Comment 17 Philippe Normand 2015-01-06 01:02:44 PST
The Mac EWS failure seems unrelated with this patch. Moreover the Mac port doesn't use CMake so I think this is safe for landing.
Comment 18 Alex Christensen 2015-05-14 12:07:04 PDT
(In reply to comment #17)
> The Mac EWS failure seems unrelated with this patch. 
I agree.
> Moreover the Mac port doesn't use CMake so I think this is safe for landing.
I think this is safe for landing, but I would have to change it to (WTF_OS_MAC_OS_X && GTK) or whatever the CMake equivalent is once I get back to getting CMake working on Mac for the non-GTK Mac port, which I assume does not use libedit (I'm not familiar with libedit).  I'm ok with this patch with or without this change.
Comment 19 Philip Chimento 2015-05-17 11:59:39 PDT
libedit is a BSD-licensed replacement for the GNU readline library. I assume JSC uses it in its REPL.
Comment 20 WebKit Commit Bot 2015-10-12 10:04:23 PDT
Comment on attachment 243919 [details]
Patch

Clearing flags on attachment: 243919

Committed r190857: <http://trac.webkit.org/changeset/190857>
Comment 21 WebKit Commit Bot 2015-10-12 10:04:32 PDT
All reviewed patches have been landed.  Closing bug.