summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1')
-rwxr-xr-xmdk-stage1/dietlibc/findcflags.sh8
-rwxr-xr-xmdk-stage1/dietlibc/threadsafe.sh5
2 files changed, 13 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/findcflags.sh b/mdk-stage1/dietlibc/findcflags.sh
new file mode 100755
index 000000000..8b8b3d74a
--- /dev/null
+++ b/mdk-stage1/dietlibc/findcflags.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+version=`${1:-gcc} -v 2>&1 |sed -n '/gcc version/ {s/gcc version //;p;}'`
+case $version in
+ 2.9*) echo -march=i386 -Os -fomit-frame-pointer -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mpreferred-stack-boundary=2 ;;
+ 3.0*) echo -march=i386 -Os -fomit-frame-pointer -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mpreferred-stack-boundary=2 ;;
+ 3*) echo -Os -fomit-frame-pointer -falign-functions=0 -falign-jumps=0 -falign-loops=0 -mpreferred-stack-boundary=2;;
+ *) echo -O2 -pipe -fomit-frame-pointer ;;
+esac
diff --git a/mdk-stage1/dietlibc/threadsafe.sh b/mdk-stage1/dietlibc/threadsafe.sh
new file mode 100755
index 000000000..67f6f6338
--- /dev/null
+++ b/mdk-stage1/dietlibc/threadsafe.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+(gcc -E - << EOF | grep -q WANT_THREAD_SAFE) || echo libpthread/pthread_*.c
+#include "dietfeatures.h"
+WANT_THREAD_SAFE
+EOF