Index: apps/plugins/plugins.make
===================================================================
--- apps/plugins/plugins.make	(revision 29941)
+++ apps/plugins/plugins.make	(arbetskopia)
@@ -98,7 +98,8 @@
 	$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINFLAGS) -c $< -o $@
 
 ifdef APP_TYPE
- PLUGINLDFLAGS = $(SHARED_FLAG) # <-- from Makefile
+ PLUGINLDFLAGS = $(SHARED_LDFLAG) # <-- from Makefile
+ PLUGINFLAGS += $(SHARED_CFLAGS) # <-- from Makefile
 else
  PLUGINLDFLAGS = -T$(PLUGINLINK_LDS) -Wl,--gc-sections -Wl,-Map,$*.map
  OVERLAYLDFLAGS = -T$(OVERLAYREF_LDS) -Wl,--gc-sections -Wl,-Map,$*.refmap
Index: apps/codecs/codecs.make
===================================================================
--- apps/codecs/codecs.make	(revision 29941)
+++ apps/codecs/codecs.make	(arbetskopia)
@@ -112,7 +112,8 @@
 		-I$(dir $<) $(CODECFLAGS) $(ASMFLAGS) -c $< -o $@
 
 ifdef APP_TYPE
- CODECLDFLAGS = $(SHARED_FLAG) # <-- from Makefile
+ CODECLDFLAGS = $(SHARED_LDFLAG) # <-- from Makefile
+ CODECFLAGS += $(SHARED_CFLAGS) # <-- from Makefile
 else
  CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
  CODECFLAGS += -UDEBUG -DNDEBUG
Index: apps/plugins/lua/Makefile
===================================================================
--- apps/plugins/lua/Makefile	(revision 29941)
+++ apps/plugins/lua/Makefile	(arbetskopia)
@@ -55,7 +55,7 @@
 # This is the SDL simulator version
 
 $(OUTPUT): $(OBJS)
-	$(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+	$(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_LDFLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
 # 'x' must be kept or you'll have "Win32 error 5"
 #     $ fgrep 5 /usr/include/w32api/winerror.h | head -1
Index: apps/plugins/SUBDIRS
===================================================================
--- apps/plugins/SUBDIRS	(revision 29941)
+++ apps/plugins/SUBDIRS	(arbetskopia)
@@ -18,7 +18,7 @@
     && (LCD_PIXELFORMAT != VERTICAL_INTERLEAVED) /* TODO */ \
     && (defined(HAVE_LCD_COLOR) || (LCD_HEIGHT == 64) && (LCD_DEPTH == 1) || \
                                    (LCD_HEIGHT == 128) && (LCD_DEPTH == 2))
-rockboy
+//rockboy
 #endif
 
 #ifdef HAVE_TAGCACHE
@@ -58,7 +58,7 @@
 #if (defined(HAVE_LCD_COLOR) || defined(MROBE_100) || defined(SANSA_CLIPPLUS) \
     || defined(SANSA_CLIPV2) || (LCD_DEPTH == 2)) \
     && (MEMORYSIZE > 2 && !defined(RB_PROFILE))
-doom
+//doom
 #endif
 
 /* For all the swcodec targets */
Index: tools/configure
===================================================================
--- tools/configure	(revision 29941)
+++ tools/configure	(arbetskopia)
@@ -219,7 +219,8 @@
  fi
 
  # default share option, override below if needed
- SHARED_FLAG="-shared"
+ SHARED_LDFLAG="-shared"
+ SHARED_CFLAGS="-fPIC -fvisibility=hidden"
 
  if [ "$win32crosscompile" = "yes" ]; then
    LDOPTS="$LDOPTS -mconsole"
@@ -261,7 +262,7 @@
    sigaltstack=`check_sigaltstack`
    echo "Darwin host detected"
    LDOPTS="$LDOPTS -ldl"
-   SHARED_FLAG="-dynamiclib -Wl\,-single_module"
+   SHARED_LDFLAG="-dynamiclib -Wl\,-single_module"
    ;;
 
    SunOS)
@@ -299,21 +300,12 @@
  GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
 
  if test "X$win32crosscompile" != "Xyes"; then
-   case `uname -m` in
-    x86_64|amd64)
-      # fPIC is needed to make shared objects link
-      # setting visibility to hidden is necessary to avoid strange crashes
-      # due to symbol clashing
-      GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
-      # x86_64 supports MMX by default
-    ;;
+   if test "`uname -m`" = "i686"; then
+     echo "Enabling MMX support"
+     GCCOPTS="$GCCOPTS -mmmx"
+   fi
+   # x86_64 supports MMX by default
 
-    i686)
-      echo "Enabling MMX support"
-      GCCOPTS="$GCCOPTS -mmmx"
-    ;;
-   esac
-
    id=$$
    cat >$tmpdir/conftest-$id.c <<EOF
 #include <stdio.h>
@@ -526,7 +518,8 @@
  GCCOPTIMIZE=''
  LDOPTS="-lm -ldl $LDOPTS"
  GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs"
- SHARED_FLAG="-shared"
+ SHARED_LDFLAG="-shared"
+ SHARED_CFLAGS=''
  endian="little"
  thread_support="HAVE_SIGALTSTACK_THREADS"
 
@@ -620,7 +613,8 @@
  GCCOPTIMIZE=''
  LDOPTS="-lm -ldl $LDOPTS"
  GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs"
- SHARED_FLAG="-shared"
+ SHARED_LDFLAG="-shared"
+ SHARED_CFLAGS=''
  endian="little"
  thread_support="HAVE_SIGALTSTACK_THREADS"
 
@@ -665,7 +659,8 @@
 		--sysroot=$ANDROID_NDK_PATH/platforms/android-4/arch-arm"
     LDOPTS="$LDOPTS -shared -nostdlib -ldl -llog"
     endian="little"
-    SHARED_FLAG="-shared"
+    SHARED_LDFLAG="-shared"
+    SHARED_CFLAGS=''
 }
 
 whichadvanced () {
@@ -3680,7 +3675,8 @@
  -e "s<@PLUGINS@<${plugins}<g" \
  -e "s<@CODECS@<${swcodec}<g" \
  -e "s<@PROFILE_OPTS@<${PROFILE_OPTS}<g" \
- -e "s<@SHARED_FLAG@<${SHARED_FLAG}<g" \
+ -e "s<@SHARED_LDFLAG@<${SHARED_LDFLAG}<g" \
+ -e "s<@SHARED_CFLAGS@<${SHARED_CFLAGS}<g" \
  -e "s<@GCCOPTS@<${GCCOPTS}<g" \
  -e "s<@TARGET_INC@<${TARGET_INC}<g" \
  -e "s<@LDOPTS@<${LDOPTS}<g" \
@@ -3767,7 +3763,8 @@
 export GCCOPTS=@GCCOPTS@
 export TARGET_INC=@TARGET_INC@
 export LOADADDRESS=@LOADADDRESS@
-export SHARED_FLAG=@SHARED_FLAG@
+export SHARED_LDFLAG=@SHARED_LDFLAG@
+export SHARED_CFLAGS=@SHARED_CFLAGS@
 export LDOPTS=@LDOPTS@
 export GLOBAL_LDOPTS=@GLOBAL_LDOPTS@
 export GCCVER=@GCCVER@
