Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#25345 closed defect (fixed)

pkgconfig 0.25 is built with --enable-indirect-deps, causing breakage in apps that link against libsdl.

Reported by: endgame.dos@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: michaelld (Michael Dickens), exg (Emanuele Giaquinta), jmroot (Joshua Root), drkp (Dan Ports)
Port: pkgconfig

Description

I've noticed that pkg-config is built with --enable-indirect-deps, which causes Libs.private to get unconditionally printed (even when --static is not passed to pkg-config). This causes runtime failures in programs linked against SDL, because the output of pkg-config --libs sdl looks something like this:

-Wl,-framework,Cocoa /opt/local/lib/libSDLmain.a /opt/local/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit -L/opt/local/lib -lSDLmain -lSDL

In particular, this is linking the SDL .dylib and the SDL static lib. This causes runtime warnings that the classes SDLTranslatorResponder, SDL_QuartzView, SDL_QuartzWindowDelegate and SDL_QuartzWindow are implemented in two places, followed by a crash.

Removing --enable-indirect-deps from the pkgconfig portfile allows SDL apps to correctly link and run.

Change History (12)

comment:1 Changed 14 years ago by michaelld (Michael Dickens)

Cc: michaelld@… added

Cc Me!

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

Owner: changed from macports-tickets@… to ryandesign@…

Please remember to cc the maintainer.

comment:3 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

I have run into this same issue myself when working on the port for PlasmaClient. See r71898.

However, I'm worried about making a change that will affect so many ports. I'd appreciate some guidance on why this option was added to pkgconfig in the first place, and if that reason still applies.

Also, if we make this change in pkgconfig, then theoretically we'd have to revbump all ports that use pkgconfig, which is a ton of them.

comment:4 Changed 14 years ago by endgame.dos@…

Strangely enough, I don't see this any more:

$ which pkg-config
/opt/local/bin/pkg-config
$ pkg-config --cflags --libs sdl
-D_GNU_SOURCE=1 -D_THREAD_SAFE -I/opt/local/include/SDL  -Wl,-framework,Cocoa -L/opt/local/lib -lSDLmain -lSDL  

Was the libsdl port changed recently? The other libs are still there in libs.private in the .pc file.

comment:5 in reply to:  4 Changed 14 years ago by endgame.dos@…

Sorry, disregard the above. I'm using a locally modified Portfile for pkgconfig.

comment:6 in reply to:  3 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign@…:

I'd appreciate some guidance on why this option was added to pkgconfig in the first place, and if that reason still applies.

Looks like the option was added in r12236 to "Fix the problem where the configure scripts for GTK2 apps wasn't finding GTK2 even though it was installed." I do not know if this reason still applies.

Separately, I have received email from Jeremy Huddleston, saying any port that needs this option is broken and the problem should be fixed in that port, and that sounds reasonable.

Now it just remains to decide whether I simply remove the flag and revbump pkgconfig, similar to what was done in r12236 to add it, or whether I need to also revbump all ports that use pkgconfig.

comment:7 Changed 13 years ago by exg (Emanuele Giaquinta)

Cc: emanuele.giaquinta@… added

Cc Me!

comment:8 Changed 13 years ago by jmroot (Joshua Root)

You don't need to rev bump anything that is working.

comment:9 Changed 13 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

r75297 - invoking maintainer timeout as this was preventing me from updating libsdl_ttf.

comment:10 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jmr@… added

Ok, here's hoping things continue to work after that change. :)

comment:11 Changed 13 years ago by drkp (Dan Ports)

Cc: dports@… added

This appears to have broken the build for emacs +x11 (#28083). It looks like it's not getting the right linker flags for freetype and fontconfig.

I'm totally willing to believe that the problem is with emacs not pkg-config, but I'd appreciate any suggestions about how to fix it.

comment:12 Changed 13 years ago by drkp (Dan Ports)

The xournal build failure in #28085 is probably also related.

Note: See TracTickets for help on using tickets.