New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #12084 (closed defect: fixed)

Opened 6 years ago

Last modified 4 years ago

libiconv and universal variant on a Mac PPC

Reported by: philippe.bernery@… Owned by: ryandesign@…
Priority: High Milestone:
Component: ports Version: 1.4.42
Keywords: Cc: philippe.bernery@…, ryandesign@…, takanori@…, Axel.Rau@…, normanmacintyre@…
Port:

Description

I've got the following error when trying to compile libiconv with the +universal variant (configured in the global config file of macports) on a Mac PPC:

--->  Building libiconv with target all
Error: Target com.apple.build returned: shell command " cd "/opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_textproc_libiconv/work/libiconv-1.11" && make all " returned error 2
Command output: builddir="`pwd`"; cd libcharset && make all && make install-lib libdir="$builddir/lib" includedir="$builddir/lib"
cd lib && make all
/bin/sh ../libtool --mode=link gcc -L/opt/local/lib -arch i386 -arch ppc -o libcharset.la -rpath /opt/local/lib -version-info 1:0:0 -no-undefined localcharset.lo relocatable.lo
gcc -dynamiclib  -o .libs/libcharset.1.0.0.dylib  .libs/localcharset.o .libs/relocatable.o  -L/opt/local/lib  -arch i386 -arch ppc -install_name  /opt/local/lib/libcharset.1.dylib -Wl,-compatibility_version -Wl,2 -Wl,-current_version -Wl,2.0
ld: Undefined symbols:
_fclose
_fopen
_free
_fscanf
_getc
_getenv
_malloc
_memcpy
_nl_langinfo
_realloc
_strcmp
_strcpy
_ungetc
_strncmp
/usr/bin/libtool: internal link edit command failed
lipo: can't figure out the architecture type of: /var/tmp//ccita9jg.out
make[2]: *** [libcharset.la] Error 1
make[1]: *** [all] Error 2
make: *** [lib/localcharset.h] Error 2

Attachments

libiconv.diff (384 bytes) - added by takanori@… 6 years ago.

Change History

comment:1 Changed 6 years ago by pipping@…

This is a known problem that can't easily be solved.

Libiconv include the prefix it's supposed to be installed to. If a single-arch version of libiconv is already installed, libiconv +universal will try to link against the installed single-arch libraries, resulting in the above errors.

A workaround is to uninstall/deactivate the single-arch version.

comment:2 Changed 6 years ago by philippe.bernery@…

I have no libiconv installed except the one installed with Mac OS X (10.4). I uninstalled everything (with 'sudo port uninstall installed') before re-installing with the +universal variant.

comment:3 Changed 6 years ago by ryandesign@…

  • Cc ryandesign@… added

Don't forget to Cc the assignee! I only found this bug today by coincidence.

comment:4 Changed 6 years ago by takanori@…

  • Cc takanori@… added

Hi, I encountered the same problem. libiconv @1.11_4+universal fails to build on PPC-based Macs.

Anyway, here is a workaround to avoid this issue.

# In my view, configure.universal_ldflags variable should contain # this flag (-isysroot /Developer/SDKs/MacOSX10.4u.sdk) by default.

Changed 6 years ago by takanori@…

comment:5 Changed 6 years ago by takanori@…

# In my view, configure.universal_ldflags variable should contain # this flag (-isysroot /Developer/SDKs/MacOSX10.4u.sdk) by default.

Sorry, please ignore my last comment. It was a bad idea since ld cannot handle -isysroot flag, as you know.

comment:6 Changed 6 years ago by ryandesign@…

  • Cc Axel.Rau@…, normanmacintyre@… added

comment:7 Changed 6 years ago by ryandesign@…

#12785 is a duplicate.

comment:8 Changed 6 years ago by ryandesign@…

  • Status changed from new to closed
  • Resolution set to fixed

Sorry, I misread the comments before. I thought a fix had been proposed, then immediately declared no good. I see now that the fix to the portfile was ok, but that the proposed general-purpose fix was no good.

I committed what I thought was a better version of the change in r31117, then changed my mind and committed exactly what takanori wrote in r31118. Thanks to takanori for your help, and sorry to everyone for the delay.

comment:9 Changed 4 years ago by anonymous

  • Milestone Port Bugs deleted

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.