[Galaxy S III Q&A, Help & Troubleshooting] JonoCoetz:
This is more of a development question but I don't have enough posts to post to the dev forum.

I'm looking to compile CM10 for my i9300 using GCC 4.7, mainly for the sake of interest but also to see the effects of the ARM improvements in the lastest version of the compiler. I'm not using the Linaro toolchain but the 4.7 toolchain from android.googlesource.com

Apart from some minor code changes that needed to be made in order for things to compile I'm running into one problem that I cannot solve. When linking libstlport.so I get the following errors:

~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ~/android/system/out/target/product/i9300/obj/SHARED_LIBRARIES/libstlport_intermediates/src/monetary.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ~/android/system/out/target/product/i9300/obj/SHARED_LIBRARIES/libstlport_intermediates/src/locale.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ~/android/system/out/target/product/i9300/obj/SHARED_LIBRARIES/libstlport_intermediates/src/locale_impl.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ~/android/system/out/target/product/i9300/obj/SHARED_LIBRARIES/libstlport_intermediates/src/locale_impl.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ~/android/system/out/target/product/i9300/obj/SHARED_LIBRARIES/libstlport_intermediates/src/locale_impl.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ~/android/system/out/target/product/i9300/obj/SHARED_LIBRARIES/libstlport_intermediates/src/locale_impl.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ~/android/system/out/target/product/i9300/obj/SHARED_LIBRARIES/libstlport_intermediates/src/locale_impl.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ~/android/system/out/target/product/i9300/obj/SHARED_LIBRARIES/libstlport_intermediates/src/allocators.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally

BTW, instead of fiddling with envsetup.sh I copied the GCC 4.7 toolchain into the GCC 4.6 directory.

I've Googled it like crazy but I've only found either really old or unanswered posts. Obviously, this isn't a when using GCC 4.6 as is. Anyone know what's going wrong here and how I can solve it?