Don't forget to run autoconf under bfd after applying the patch.

On Sun, Oct 13, 2013 at 3:43 PM, Raul Fajardo <[email protected]> wrote:

> I successfully installed the newlib toolchain under OSX Mountain Lion.
>
> Binutils has compiled with -disable-werror. But GCC compilation failed
> then because libbfd.a was not correctly linked to gettext. The error was:
>
>
> http://gcc.gnu.org/wiki/FAQ#Configuration_fails_with_.27.27configure:_error:_cannot_compute_suffix_of_object_files:_cannot_compile.27.27._What_is_the_problem.3F
>
> And occurred because the binutil tools failed with something like:
>
> collect2: ld terminated with signal 5 [Trace/BPT trap]
> dyld: lazy symbol binding failed: Symbol not found: _libintl_dgettext
>   Referenced from: 
> /Volumes/btc-0.12/gcc-4.4/i386-apple-darwin9.8.0/powerpc-linux-gnu/lib/libb
> fd-2.20.1.20100303.dylib
>   Expected in: dynamic lookup
>
>
> I found out that a link from libbfd.a to libintl.a had to be created under
> the following url:
> http://www.telegraphics.com.au/~fthain/sw/build-tool-chain/btc-20110616/patches/binutils-2.20.1-darwin-libbfd-link.diff
>
> However, this workaround failed when compiling GCC with binutils because
> it was compiling libintl.a into libbfd.a instead of linking.
> Relevant warning:
> *** Warning: Linking the shared library libbfd.la against the
> *** static library ../intl/libintl.a is not portable!
>
> Giving a try to some reading about autobuild, I have came up with a patch
> that worked under both cases. (below)
>
> I will post the recipe to install the newlib toolchain under OSX Mountain
> Lion to OpenCores Wiki next.
>
> diff --git a/bfd/configure.in b/bfd/configure.in
> index 7a91678..e30dc45 100644
> --- a/bfd/configure.in
> +++ b/bfd/configure.in
> @@ -568,7 +568,7 @@ changequote(,)dnl
>    x=`sed -n -e 's/^[   ]*PICFLAG[      ]*=[    ]*//p' <
> ../libiberty/Makefile | sed -n '$p'`
>  changequote([,])dnl
>    if test -n "$x"; then
> -    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
> +    SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty
> -lintl"
>    fi
>
>  # More hacks to build DLLs on Windows.
>
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to