compiling latest toolchain on osx, iconv problem at stage 2

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
f_bohmann
Posts: 16
Joined: Mon May 02, 2005 7:15 pm
Location: hamburg, germany

compiling latest toolchain on osx, iconv problem at stage 2

Post by f_bohmann »

heyho... im trying to build the toolchain (svn rev. 2446) for osx for 2 days now, but step 002 fails on me with:

======================================

gcc -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -o cc1-dummy c-lang.o stub-objc.o attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o c-objc-common.o c-dump.o c-pch.o c-parser.o c-gimplify.o tree-mudflap.o c-pretty-print.o c-omp.o dummy-checksum.o \
main.o libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a ./../intl/libintl.a -liconv ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -L/opt/local/lib -L/opt/local/include//lib -lmpfr -lgmp
Undefined symbols:
"_iconv_close", referenced from:
__cpp_destroy_iconv in libcpp.a(charset.o)
__cpp_destroy_iconv in libcpp.a(charset.o)
__cpp_convert_input in libcpp.a(charset.o)
__nl_free_domain_conv in libintl.a(loadmsgcat.o)
"_iconv", referenced from:
_convert_using_iconv in libcpp.a(charset.o)
_convert_using_iconv in libcpp.a(charset.o)
_convert_using_iconv in libcpp.a(charset.o)
_convert_using_iconv in libcpp.a(charset.o)
__nl_find_msg in libintl.a(dcigettext.o)
"_iconv_open", referenced from:
_init_iconv_desc in libcpp.a(charset.o)
__nl_init_domain_conv in libintl.a(loadmsgcat.o)
__nl_init_domain_conv in libintl.a(loadmsgcat.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [cc1-dummy] Error 1
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2
../scripts/002-gcc-4.3.2-stage1.sh: Failed.

======================================

i had to change the 002 script to

../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c" --with-newlib --with-gmp-include=/opt/local/include --with-gmp-lib=/opt/local/lib --with-mpfr=/opt/local/include/ --without-headers --disable-libssp || { exit 1; }

(note the extra paths for gmp and mpfr) since i am using macports an not fink.

any ideas what im missing out? i installed libiconv, added -liconv to the linker flags, but that gives the same error.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

When I installed libgmp and libmpfr on Leopard I had to run configure passing the path to install to, instead of the default /opt/local.

Code: Select all

./configure --prefix=/usr
I think that was it.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Insert_witty_name wrote:When I installed libgmp and libmpfr on Leopard I had to run configure passing the path to install to, instead of the default /opt/local.

Code: Select all

./configure --prefix=/usr
I think that was it.
Shouldn't this be hard coded into the script?

Wally
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

The script doesn't install libgmp and libmpfr. So, no.

Also, installing them into /usr/local is generally a better idea.
f_bohmann
Posts: 16
Joined: Mon May 02, 2005 7:15 pm
Location: hamburg, germany

Post by f_bohmann »

ooPo wrote:The script doesn't install libgmp and libmpfr. So, no.
Also, installing them into /usr/local is generally a better idea.
got it. gmp needs to be compiled with "ABI=32", else it will not match mpfr et al.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

f_bohmann wrote:
ooPo wrote:The script doesn't install libgmp and libmpfr. So, no.
Also, installing them into /usr/local is generally a better idea.
got it. gmp needs to be compiled with "ABI=32", else it will not match mpfr et al.
Ahh yes, on Leopard that is true.

I forgot that step.

If you don't, it compiles it as 64-bit which breaks other things.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

If anyone wants to write up a nice readme.osx file with all these little helpful hints, I'd certainly be happy to include it in the psptoolchain package. :)
Post Reply