Opened 11 years ago

Closed 11 years ago

#42846 closed defect (fixed)

libsndfile @1.0.25 fails linking phase on mavericks 10.9.2

Reported by: posita (Matt Bogosian) Owned by: janstary (Jan Starý)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: sk-public@…, dellw01@…, axel.roebel@…, jwhowse4, ryandesign (Ryan Carsten Schmidt)
Port: libsndfile

Description

main.log attached. It looks like it might be missing a dependency on an Ogg Vorbis library?

Attachments (2)

lbsndfile_main.log (156.0 KB) - added by posita (Matt Bogosian) 11 years ago.
configure.patch (717 bytes) - added by axel.roebel@… 11 years ago.
configure.patch replacement for libsndfile on Mavericks (should work for all other versions of mac os x)

Download all attachments as: .zip

Change History (17)

Changed 11 years ago by posita (Matt Bogosian)

Attachment: lbsndfile_main.log added

comment:1 Changed 11 years ago by posita (Matt Bogosian)

Relevant portion:

:info:build /bin/sh ../libtool  --tag=CC   --mode=link /usr/bin/clang  -pipe -Os -arch x86_64 -std=gnu99 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -funsigned-char -Wstrict-prototypes -Wmissing-prototypes  -Wcast-align -Wcast-qual -Wnested-externs  -Wbad-function-cast -Wwrite-strings -Wundef -pipe  -no-undefined -version-info 1:25:0 -Wl,-exported_symbols_list -Wl,./Symbols.darwin -L/[[PREFIX]]/lib -Wl,-headerpad_max_install_names -arch x86_64 -o libsndfile.la -rpath /[[PREFIX]]/lib sndfile.lo aiff.lo au.lo avr.lo caf.lo dwd.lo flac.lo g72x.lo htk.lo ircam.lo macbinary3.lo macos.lo mat4.lo mat5.lo nist.lo paf.lo pvf.lo raw.lo rx2.lo sd2.lo sds.lo svx.lo txw.lo voc.lo wve.lo w64.lo wav_w64.lo wav.lo xi.lo mpc2k.lo rf64.lo ogg_vorbis.lo ogg_speex.lo ogg_pcm.lo   libcommon.la GSM610/libgsm.la G72x/libg72x.la -L/[[PREFIX]]/lib -lFLAC  -L/[[PREFIX]]/lib -lvorbisenc   -lm -lm 
:info:build libtool: link: /usr/bin/clang -dynamiclib  -o .libs/libsndfile.1.dylib  .libs/sndfile.o .libs/aiff.o .libs/au.o .libs/avr.o .libs/caf.o .libs/dwd.o .libs/flac.o .libs/g72x.o .libs/htk.o .libs/ircam.o .libs/macbinary3.o .libs/macos.o .libs/mat4.o .libs/mat5.o .libs/nist.o .libs/paf.o .libs/pvf.o .libs/raw.o .libs/rx2.o .libs/sd2.o .libs/sds.o .libs/svx.o .libs/txw.o .libs/voc.o .libs/wve.o .libs/w64.o .libs/wav_w64.o .libs/wav.o .libs/xi.o .libs/mpc2k.o .libs/rf64.o .libs/ogg_vorbis.o .libs/ogg_speex.o .libs/ogg_pcm.o   -Wl,-force_load,./.libs/libcommon.a -Wl,-force_load,GSM610/.libs/libgsm.a -Wl,-force_load,G72x/.libs/libg72x.a  -L/[[PREFIX]]/lib -lFLAC -lvorbisenc -lm  -Os -arch x86_64 -Wl,-exported_symbols_list -Wl,./Symbols.darwin -Wl,-headerpad_max_install_names -arch x86_64   -install_name  /[[PREFIX]]/lib/libsndfile.1.dylib -compatibility_version 2 -current_version 2.25 -Wl,-single_module
:info:build Undefined symbols for architecture x86_64:
:info:build   "_ogg_page_eos", referenced from:
:info:build       _ogg_vorbis_open in ogg_vorbis.o
:info:build       _vorbis_close in ogg_vorbis.o
:info:build       _vorbis_read_sample in ogg_vorbis.o
:info:build       _vorbis_write_samples in ogg_vorbis.o
...
:info:build   "_vorbis_version_string", referenced from:
:info:build       _ogg_vorbis_open in ogg_vorbis.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)

comment:2 Changed 11 years ago by mf2k (Frank Schima)

Cc: hans@… removed
Owner: changed from macports-tickets@… to hans@…

comment:3 Changed 11 years ago by jwhowse4

This also occurs for me under Mountain Lion with XCode 5.1. One problem appears to me to be that the package configure script thinks the architecture is i386 when it is in fact x86_64.

Last edited 11 years ago by jwhowse4 (previous) (diff)

comment:4 in reply to:  description Changed 11 years ago by dellw01@…

Replying to mtb19@…:

main.log attached. It looks like it might be missing a dependency on an Ogg Vorbis library?

Installing with +no_external_libs variant, which disables support for Flac, Ogg and Vorbis works fine. Whether it is a pure dependency problem or building with the wrong architecture as jwhowse4 suggests I'm not sure at this point.

comment:5 Changed 11 years ago by janstary (Jan Starý)

The same happens on an my Intel-based Macbook running 10.6.8

I don't think it's a dependency problem. The Portfile says depends_lib port:flac port:libogg port:libvorbis and indeed your log shows flac 1.2.1, ogg 1.1.3 and vorbis 1.2.3 installed and found.

I thought it's architecture confusion: The compiling and linking happens with "-arch x86_64". The "build_arch" and "universal_archs" and their defaults seem relevant here. See what macports.conf says. On my system, "sudo port platform" says "Platform: darwin 10 i386", but maybe macports applies the "x86_64" default on Intel 64. If change my build_arch to i386, the same problem happens with "-arch i386".

These are added by macports; the build system of libsndfile itself (./configure, make from the very same source) compiles and links juts fine.

To be honest, I am not sure what exactly is hapenning here, but it definitely has to do with the "-arch" option added t the build chain by macports. To test, is there also a way to make macports NOT specify any "-arch" and just compile/link for the "native" architecture"?

Changed 11 years ago by axel.roebel@…

Attachment: configure.patch added

configure.patch replacement for libsndfile on Mavericks (should work for all other versions of mac os x)

comment:6 Changed 11 years ago by axel.roebel@…

A few link libraries were missing, this seems to be fixed by the configure patch replacement I attached here. please test...

comment:7 Changed 11 years ago by janstary (Jan Starý)

I can confirm this fixes it for me on 10.6.8. Thanks!

comment:8 Changed 11 years ago by posita (Matt Bogosian)

I can also confirm the build works on 10.9.2 after the patch.1

1 I should note that applying the patch failed on the hunk removing the OS_SPECIFIC_CFLAGS line. It seems to be harmless error though. (At least on my installation) that line has already been omitted in the configure file.

Last edited 11 years ago by posita (Matt Bogosian) (previous) (diff)

comment:9 Changed 11 years ago by janstary (Jan Starý)

Axel's configure.patch is supposed to _replace_ the configure.patch we currently have in files/

comment:10 Changed 11 years ago by posita (Matt Bogosian)

<embarrassed>Whoops! Mea culpa.</embarrassed>

comment:11 Changed 11 years ago by janstary (Jan Starý)

Axel's patch has been commited upstream.

comment:12 Changed 11 years ago by jwhowse4

The new configure.patch works for me on 10.8.5 but I am still troubled by the fact it is using the wrong architecture...

comment:13 Changed 11 years ago by sk-public@…

Cc: sk-public@… added

Cc Me!

comment:14 in reply to:  12 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jwhowse4@…:

The new configure.patch works for me on 10.8.5 but I am still troubled by the fact it is using the wrong architecture...

If you are referring to the portion of the log that reads:

    Host CPU : ............................ i386

I wouldn't be concerned. As far as I can tell, the configure script is just printing the value of the standard autoconf host_cpu variable, but is not using that value to make any decisions. As far as I know, it is normal for this variable to have the value "i386" on all Intel Macs, and this variable is largely irrelevant on OS X. The architecture for which software is actually built is controlled by the -arch flags that MacPorts adds.

comment:15 in reply to:  7 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: dellw01@… axel.roebel@… jwhowse4@… ryandesign@… added
Resolution: fixed
Status: newclosed

Replying to hans@…:

I can confirm this fixes it for me on 10.6.8. Thanks!

I've committed it in r118290.

jwhowse4, please see my previous remark in the ticket; I didn't realize you weren't yet Cc'd.

Note: See TracTickets for help on using tickets.