On Mon, 7 Feb 2011 17:18:40 +0200
Ira Rosen <ira.ro...@linaro.org> wrote:
> Hi,
>
> I'd like to check vzip/vuzp patch in big endian mode. But when I try
> to compile with -mbig-endian flag, I get
>
> > ~/mainline/bin/bin/gcc -O3 -mfloat-abi=softfp -mfpu=neon
> > neon-vtrnu8.c -mbig-endian
> /home/irar/mainline/bin/lib/gcc/armv7l-unknown-linux-gnueabi/4.6.0/../../../libgcc_s.so.1:
> could not read symbols: File in wrong format
> collect2: ld returned 1 exit status
>
> What am I missing?
Building for big-endian ARM is Really Hard (IMO) :-). You can't
intermix little-endian and big-endian objects at all, so you either
need an entirely-big-endian compiler, or to build one with
little-endian/big-endian switchable multilibs.
I've attached a little patch which adds hardwired big-endian multilib
configs for ARM EABI and ARM Linux -- though I'm pretty sure I only got
one of those working, and I don't remember which. Using it outside
CodeSourcery's build environment is probably also non-trivial.
Once it works you should be able to build binaries for either
little-endian (default) or big-endian (by adding -mbig-endian). You'll
need a big-endian Newlib/GLIBC/etc. as well... but maybe this is useful
as a starting point.
Anyway, hope that helps a bit...
Julian
Index: gcc/config/arm/linux-eabi.h
===================================================================
--- gcc/config/arm/linux-eabi.h (revision 167434)
+++ gcc/config/arm/linux-eabi.h (working copy)
@@ -101,3 +101,8 @@
is used. */
#undef CLEAR_INSN_CACHE
#define CLEAR_INSN_CACHE(BEG, END) not_used
+
+#undef SYSROOT_SUFFIX_SPEC
+#define SYSROOT_SUFFIX_SPEC \
+ "%{mbig-endian:/be}"
+
Index: gcc/config/arm/neon.md
===================================================================
Index: gcc/config/arm/t-linux-eabi
===================================================================
--- gcc/config/arm/t-linux-eabi (revision 167434)
+++ gcc/config/arm/t-linux-eabi (working copy)
@@ -21,8 +21,12 @@ TARGET_LIBGCC2_CFLAGS = -fPIC
# We do not build a Thumb multilib for Linux because the definition of
# CLEAR_INSN_CACHE in linux-gas.h does not work in Thumb mode.
-MULTILIB_OPTIONS =
-MULTILIB_DIRNAMES =
+MULTILIB_OPTIONS = mbig-endian
+MULTILIB_DIRNAMES = be
+MULTILIB_OSDIRNAMES = mbig-endian=!be
+MULTILIB_MATCHES =
+MULTILIB_EXCEPTIONS =
+MULTILIB_ALIASES =
# Use a version of div0 which raises SIGFPE, and a special __clear_cache.
LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx _clear_cache
Index: gcc/config/arm/t-arm-elf
===================================================================
--- gcc/config/arm/t-arm-elf (revision 167434)
+++ gcc/config/arm/t-arm-elf (working copy)
@@ -31,8 +31,8 @@ LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi
_arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf \
_clzsi2 _clzdi2
-MULTILIB_OPTIONS = marm/mthumb
-MULTILIB_DIRNAMES = arm thumb
+MULTILIB_OPTIONS = marm
+MULTILIB_DIRNAMES = arm
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES =
@@ -57,9 +57,9 @@ MULTILIB_EXCEPTIONS += *mthumb/*mfloa
# MULTILIB_DIRNAMES += ep9312
# MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312*
#
-# MULTILIB_OPTIONS += mlittle-endian/mbig-endian
-# MULTILIB_DIRNAMES += le be
-# MULTILIB_MATCHES += mbig-endian=mbe mlittle-endian=mle
+MULTILIB_OPTIONS += mlittle-endian/mbig-endian
+MULTILIB_DIRNAMES += le be
+MULTILIB_MATCHES += mbig-endian=mbe mlittle-endian=mle
#
# MULTILIB_OPTIONS += mhard-float/msoft-float
# MULTILIB_DIRNAMES += fpu soft
Index: gcc/config/arm/t-linux
===================================================================
--- gcc/config/arm/t-linux (revision 167434)
+++ gcc/config/arm/t-linux (working copy)
@@ -28,6 +28,9 @@ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3
# MULTILIB_OPTIONS = mhard-float/msoft-float
# MULTILIB_DIRNAMES = hard-float soft-float
+MULTILIB_OPTIONS += mbig-endian/mlittle-endian
+MULTILIB_DIRNAMES += be le
+
# EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
# LIBGCC = stmp-multilib
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-toolchain