Bug 136018 - [GTK] Add library search paths from LDFLAGS before pkg-config --libs
Summary: [GTK] Add library search paths from LDFLAGS before pkg-config --libs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-16 03:40 PDT by Ting-Wei Lan
Modified: 2014-11-17 02:48 PST (History)
7 users (show)

See Also:


Attachments
Build log of WebKit revision 172688 on FreeBSD (795.47 KB, application/octet-stream)
2014-08-16 03:40 PDT, Ting-Wei Lan
no flags Details
Build log of WebKit revision 172702 on FreeBSD (817.36 KB, text/x-log)
2014-08-18 08:59 PDT, Ting-Wei Lan
no flags Details
Build log of WebKit revision 173137 on FreeBSD (815.71 KB, text/x-log)
2014-08-30 11:09 PDT, Ting-Wei Lan
no flags Details
Adding required flags to g-ir-scanner command line without using LDFLAGS (4.10 KB, patch)
2014-10-12 07:36 PDT, Ting-Wei Lan
no flags Details | Formatted Diff | Diff
Adding required flags to g-ir-scanner command line without using LDFLAGS (2.96 KB, patch)
2014-10-15 01:48 PDT, Ting-Wei Lan
no flags Details | Formatted Diff | Diff
Use LD_LIBRARY_PATH to make g-ir-scanner use the newly-built version of libraries when running the temporary executable (2.51 KB, patch)
2014-10-15 01:49 PDT, Ting-Wei Lan
no flags Details | Formatted Diff | Diff
[GTK] Add library search paths from LDFLAGS before pkg-config --libs (1.74 KB, patch)
2014-11-13 08:32 PST, Ting-Wei Lan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2014-08-16 03:40:51 PDT
Created attachment 236711 [details]
Build log of WebKit revision 172688 on FreeBSD

+++ This bug was initially created as a clone of Bug #134483 +++

I tried to build WebKitGTK+ trunk on FreeBSD 10.0-RELEASE with Clang 3.3 in the base system, but there are many errors.
Comment 1 Zan Dobersek 2014-08-18 01:27:01 PDT
This specific error was fixed a few days ago, in r172690.
http://trac.webkit.org/changeset/172690

Can you try compiling again with a newer version of trunk? If all goes fine for you this should be marked as a duplicate of bug #136017.
Comment 2 Ting-Wei Lan 2014-08-18 08:59:42 PDT
Created attachment 236764 [details]
Build log of WebKit revision 172702 on FreeBSD

LDFLAGS is unset when running g-ir-scanner, so ld cannot find libintl in /usr/local/lib.
Comment 3 Ting-Wei Lan 2014-08-30 11:09:59 PDT
Created attachment 237412 [details]
Build log of WebKit revision 173137 on FreeBSD
Comment 4 Carlos Alberto Lopez Perez 2014-08-30 12:54:32 PDT
The error is:

/usr/bin/ld: cannot find -lintl

If you google for: FreeBSD "cannot find -lintl"

you get some results that may help you to track down the issue.
Comment 5 Ting-Wei Lan 2014-08-30 22:16:48 PDT
(In reply to comment #4)
> The error is:
> 
> /usr/bin/ld: cannot find -lintl
> 
> If you google for: FreeBSD "cannot find -lintl"
> 
> you get some results that may help you to track down the issue.

I set LDFLAGS="-L/usr/local/lib" in the environment in order to find libintl, but it is unset in Source/WebKit2/PlatformGTK.cmake when running g-ir-scanner.
Comment 6 Carlos Alberto Lopez Perez 2014-08-31 09:40:52 PDT
You have to set LDFLAGS, CXXFLAGS or CCFLAGS inside the "--makeargs=" option of the script Tools/Scripts/build-webkit. Check: Tools/Scripts/build-webkit --help

Try this:

Tools/Scripts/build-webkit --gtk --release --makeargs='LDFLAGS="-L/usr/local/lib"'

If this does not work, then try setting also --cmakeargs='LDFLAGS="-L/usr/local/lib"'
Comment 7 Ting-Wei Lan 2014-08-31 20:58:14 PDT
(In reply to comment #6)
> You have to set LDFLAGS, CXXFLAGS or CCFLAGS inside the "--makeargs=" option of the script Tools/Scripts/build-webkit. Check: Tools/Scripts/build-webkit --help
> 
> Try this:
> 
> Tools/Scripts/build-webkit --gtk --release --makeargs='LDFLAGS="-L/usr/local/lib"'

I don't use build-webkit script. I use cmake directly inside the GNOME JHBuild environment. The command I used to build it is

cmake -DCMAKE_BUILD_TYPE=Release -DPORT=GTK

JHBuild already sets many needed environment variables, including LDFLAGS="-L/home/lantw44/gnome/devinstall/lib -L/usr/local/lib". However, this does not work because LDFLAGS is ignored because of this bug:
https://bugs.webkit.org/show_bug.cgi?id=132220

> 
> If this does not work, then try setting also --cmakeargs='LDFLAGS="-L/usr/local/lib"'
Comment 8 Carlos Alberto Lopez Perez 2014-09-01 04:19:02 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > You have to set LDFLAGS, CXXFLAGS or CCFLAGS inside the "--makeargs=" option of the script Tools/Scripts/build-webkit. Check: Tools/Scripts/build-webkit --help
> > 
> > Try this:
> > 
> > Tools/Scripts/build-webkit --gtk --release --makeargs='LDFLAGS="-L/usr/local/lib"'
> 
> I don't use build-webkit script. I use cmake directly inside the GNOME JHBuild environment. The command I used to build it is
> 
> cmake -DCMAKE_BUILD_TYPE=Release -DPORT=GTK
> 
> JHBuild already sets many needed environment variables, including LDFLAGS="-L/home/lantw44/gnome/devinstall/lib -L/usr/local/lib". However, this does not work because LDFLAGS is ignored because of this bug:
> https://bugs.webkit.org/show_bug.cgi?id=132220
> 

Try with any (or both) of this:
cmake [...] -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS)"
Comment 9 Ting-Wei Lan 2014-09-01 10:22:13 PDT
(In reply to comment #8)
> Try with any (or both) of this:
> cmake [...] -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS)"

I still get the same error ...
Can flags used by g-ir-scanner be passed using this?
Comment 10 Carlos Alberto Lopez Perez 2014-09-01 10:29:18 PDT
(In reply to comment #9)
> (In reply to comment #8)
> > Try with any (or both) of this:
> > cmake [...] -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS)"
> 
> I still get the same error ...
> Can flags used by g-ir-scanner be passed using this?

try with:

export gir_LDFLAGS="$(LDFLAGS)"

https://mail.gnome.org/archives/commits-list/2010-June/msg01921.html
Comment 11 Ting-Wei Lan 2014-09-02 05:49:18 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > Try with any (or both) of this:
> > > cmake [...] -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS)"
> > 
> > I still get the same error ...
> > Can flags used by g-ir-scanner be passed using this?
> 
> try with:
> 
> export gir_LDFLAGS="$(LDFLAGS)"
> 
> https://mail.gnome.org/archives/commits-list/2010-June/msg01921.html

This still does not work ...
Comment 12 Ting-Wei Lan 2014-10-11 10:37:36 PDT
gir_LDFLAGS is not used in g-ir-scanner, and CMAKE_MODULE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS are not used when running g-ir-scanner. Is there any other way to fix the problem?
Comment 13 Ting-Wei Lan 2014-10-12 07:36:13 PDT
Created attachment 239704 [details]
Adding required flags to g-ir-scanner command line without using LDFLAGS
Comment 14 Carlos Garcia Campos 2014-10-14 02:04:27 PDT
Comment on attachment 239704 [details]
Adding required flags to g-ir-scanner command line without using LDFLAGS

View in context: https://bugs.webkit.org/attachment.cgi?id=239704&action=review

> Source/WebKit2/ChangeLog:19
> +        This patch also modify LD_LIBRARY_PATH to make sure the dynamic linker
> +        find the correct version of libraries when running the temporary
> +        executable to generate the .gir file.

I don't understand why you need this, and it looks to me like a different issue in any case.
Comment 15 Ting-Wei Lan 2014-10-14 07:17:57 PDT
(In reply to comment #14)
> (From update of attachment 239704 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=239704&action=review
> 
> > Source/WebKit2/ChangeLog:19
> > +        This patch also modify LD_LIBRARY_PATH to make sure the dynamic linker
> > +        find the correct version of libraries when running the temporary
> > +        executable to generate the .gir file.
> 
> I don't understand why you need this, and it looks to me like a different issue in any case.

If I don't modify LD_LIBRARY_PATH, the executable generated by g-ir-scanner cannot find some symbols added in the new version because it links to the installed version of libraries. Should I move things related to LD_LIBRARY_PATH to a different patch?
Comment 16 Carlos Garcia Campos 2014-10-15 01:19:21 PDT
(In reply to comment #15)
> (In reply to comment #14)
> > (From update of attachment 239704 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=239704&action=review
> > 
> > > Source/WebKit2/ChangeLog:19
> > > +        This patch also modify LD_LIBRARY_PATH to make sure the dynamic linker
> > > +        find the correct version of libraries when running the temporary
> > > +        executable to generate the .gir file.
> > 
> > I don't understand why you need this, and it looks to me like a different issue in any case.
> 
> If I don't modify LD_LIBRARY_PATH, the executable generated by g-ir-scanner cannot find some symbols added in the new version because it links to the installed version of libraries. Should I move things related to LD_LIBRARY_PATH to a different patch?

Yes, please
Comment 17 Ting-Wei Lan 2014-10-15 01:48:04 PDT
Created attachment 239859 [details]
Adding required flags to g-ir-scanner command line without using LDFLAGS
Comment 18 Ting-Wei Lan 2014-10-15 01:49:17 PDT
Created attachment 239860 [details]
Use LD_LIBRARY_PATH to make g-ir-scanner use the newly-built version of libraries when running the temporary executable
Comment 19 Ting-Wei Lan 2014-10-20 20:44:10 PDT
Can anyone review the patches again?
Comment 20 Ting-Wei Lan 2014-11-13 08:32:07 PST
Created attachment 241486 [details]
[GTK] Add library search paths from LDFLAGS before pkg-config --libs
Comment 21 Alberto Garcia 2014-11-17 01:55:07 PST
(In reply to comment #20)
> Created attachment 241486 [details]
> [GTK] Add library search paths from LDFLAGS before pkg-config --libs

Looks good to me.
Comment 22 Carlos Garcia Campos 2014-11-17 02:10:13 PST
Comment on attachment 241486 [details]
[GTK] Add library search paths from LDFLAGS before pkg-config --libs

Ok, please move the other two patches to new bugs. Thanks!
Comment 23 WebKit Commit Bot 2014-11-17 02:48:38 PST
Comment on attachment 241486 [details]
[GTK] Add library search paths from LDFLAGS before pkg-config --libs

Clearing flags on attachment: 241486

Committed r176198: <http://trac.webkit.org/changeset/176198>
Comment 24 WebKit Commit Bot 2014-11-17 02:48:43 PST
All reviewed patches have been landed.  Closing bug.