summaryrefslogtreecommitdiff
path: root/tools/configure
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2011-06-07 11:56:23 +0000
committerNils Wallménius <nils@rockbox.org>2011-06-07 11:56:23 +0000
commit331b23d15b765489a9abd344ddab9771125c3754 (patch)
tree39b809790113945740bec94cfbe27eb4113ef498 /tools/configure
parentf9f96325e20be46d1cf12492818485f2f84c3c3a (diff)
downloadrockbox-331b23d15b765489a9abd344ddab9771125c3754.tar.gz
rockbox-331b23d15b765489a9abd344ddab9771125c3754.zip
FS#12144, Use -fPIC -fvisibility=hidden only for plugins on sim and app builds and enable it for 32 bit too. Fixes linking errors on simbuilds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29983 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/configure')
-rwxr-xr-xtools/configure39
1 files changed, 18 insertions, 21 deletions
diff --git a/tools/configure b/tools/configure
index 461e00ce8f..b46037c6a5 100755
--- a/tools/configure
+++ b/tools/configure
@@ -225,7 +225,8 @@ simcc () {
225 fi 225 fi
226 226
227 # default share option, override below if needed 227 # default share option, override below if needed
228 SHARED_FLAG="-shared" 228 SHARED_LDFLAG="-shared"
229 SHARED_CFLAGS="-fPIC -fvisibility=hidden"
229 230
230 if [ "$win32crosscompile" = "yes" ]; then 231 if [ "$win32crosscompile" = "yes" ]; then
231 LDOPTS="$LDOPTS -mconsole" 232 LDOPTS="$LDOPTS -mconsole"
@@ -267,7 +268,7 @@ simcc () {
267 sigaltstack=`check_sigaltstack` 268 sigaltstack=`check_sigaltstack`
268 echo "Darwin host detected" 269 echo "Darwin host detected"
269 LDOPTS="$LDOPTS -ldl" 270 LDOPTS="$LDOPTS -ldl"
270 SHARED_FLAG="-dynamiclib -Wl\,-single_module" 271 SHARED_LDFLAG="-dynamiclib -Wl\,-single_module"
271 ;; 272 ;;
272 273
273 SunOS) 274 SunOS)
@@ -305,20 +306,11 @@ simcc () {
305 GCCOPTS="$GCCOPTS -I\$(SIMDIR)" 306 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
306 307
307 if test "X$win32crosscompile" != "Xyes"; then 308 if test "X$win32crosscompile" != "Xyes"; then
308 case `uname -m` in 309 if test "`uname -m`" = "i686"; then
309 x86_64|amd64) 310 echo "Enabling MMX support"
310 # fPIC is needed to make shared objects link 311 GCCOPTS="$GCCOPTS -mmmx"
311 # setting visibility to hidden is necessary to avoid strange crashes 312 fi
312 # due to symbol clashing 313 # x86_64 supports MMX by default
313 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
314 # x86_64 supports MMX by default
315 ;;
316
317 i686)
318 echo "Enabling MMX support"
319 GCCOPTS="$GCCOPTS -mmmx"
320 ;;
321 esac
322 314
323 id=$$ 315 id=$$
324 cat >$tmpdir/conftest-$id.c <<EOF 316 cat >$tmpdir/conftest-$id.c <<EOF
@@ -532,7 +524,8 @@ maemocc () {
532 GCCOPTIMIZE='' 524 GCCOPTIMIZE=''
533 LDOPTS="-lm -ldl $LDOPTS" 525 LDOPTS="-lm -ldl $LDOPTS"
534 GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs" 526 GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs"
535 SHARED_FLAG="-shared" 527 SHARED_LDFLAG="-shared"
528 SHARED_CFLAGS=''
536 endian="little" 529 endian="little"
537 thread_support="HAVE_SIGALTSTACK_THREADS" 530 thread_support="HAVE_SIGALTSTACK_THREADS"
538 531
@@ -626,7 +619,8 @@ pandoracc () {
626 GCCOPTIMIZE='' 619 GCCOPTIMIZE=''
627 LDOPTS="-lm -ldl $LDOPTS" 620 LDOPTS="-lm -ldl $LDOPTS"
628 GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs" 621 GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs"
629 SHARED_FLAG="-shared" 622 SHARED_LDFLAG="-shared"
623 SHARED_CFLAGS=''
630 endian="little" 624 endian="little"
631 thread_support="HAVE_SIGALTSTACK_THREADS" 625 thread_support="HAVE_SIGALTSTACK_THREADS"
632 626
@@ -671,7 +665,8 @@ androidcc () {
671 --sysroot=$ANDROID_NDK_PATH/platforms/android-4/arch-arm" 665 --sysroot=$ANDROID_NDK_PATH/platforms/android-4/arch-arm"
672 LDOPTS="$LDOPTS -shared -nostdlib -ldl -llog" 666 LDOPTS="$LDOPTS -shared -nostdlib -ldl -llog"
673 endian="little" 667 endian="little"
674 SHARED_FLAG="-shared" 668 SHARED_LDFLAG="-shared"
669 SHARED_CFLAGS=''
675} 670}
676 671
677whichadvanced () { 672whichadvanced () {
@@ -3686,7 +3681,8 @@ sed > Makefile \
3686 -e "s<@PLUGINS@<${plugins}<g" \ 3681 -e "s<@PLUGINS@<${plugins}<g" \
3687 -e "s<@CODECS@<${swcodec}<g" \ 3682 -e "s<@CODECS@<${swcodec}<g" \
3688 -e "s<@PROFILE_OPTS@<${PROFILE_OPTS}<g" \ 3683 -e "s<@PROFILE_OPTS@<${PROFILE_OPTS}<g" \
3689 -e "s<@SHARED_FLAG@<${SHARED_FLAG}<g" \ 3684 -e "s<@SHARED_LDFLAG@<${SHARED_LDFLAG}<g" \
3685 -e "s<@SHARED_CFLAGS@<${SHARED_CFLAGS}<g" \
3690 -e "s<@GCCOPTS@<${GCCOPTS}<g" \ 3686 -e "s<@GCCOPTS@<${GCCOPTS}<g" \
3691 -e "s<@TARGET_INC@<${TARGET_INC}<g" \ 3687 -e "s<@TARGET_INC@<${TARGET_INC}<g" \
3692 -e "s<@LDOPTS@<${LDOPTS}<g" \ 3688 -e "s<@LDOPTS@<${LDOPTS}<g" \
@@ -3774,7 +3770,8 @@ export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
3774export GCCOPTS=@GCCOPTS@ 3770export GCCOPTS=@GCCOPTS@
3775export TARGET_INC=@TARGET_INC@ 3771export TARGET_INC=@TARGET_INC@
3776export LOADADDRESS=@LOADADDRESS@ 3772export LOADADDRESS=@LOADADDRESS@
3777export SHARED_FLAG=@SHARED_FLAG@ 3773export SHARED_LDFLAG=@SHARED_LDFLAG@
3774export SHARED_CFLAGS=@SHARED_CFLAGS@
3778export LDOPTS=@LDOPTS@ 3775export LDOPTS=@LDOPTS@
3779export GLOBAL_LDOPTS=@GLOBAL_LDOPTS@ 3776export GLOBAL_LDOPTS=@GLOBAL_LDOPTS@
3780export GCCVER=@GCCVER@ 3777export GCCVER=@GCCVER@