Update build_static_example.sh
authorDenys Vlasenko <dvlasenk@redhat.com>
Wed, 26 Jun 2013 13:07:23 +0000 (15:07 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Wed, 26 Jun 2013 13:07:23 +0000 (15:07 +0200)
Now it also contains a tested example of i686 build on 64-bit host.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
build_static_example.sh

index 5e5fb425fe37233650699079de58bdc8580ece68..5c0e5fab5d7c80a73144b5f291ccd30b27a14263 100755 (executable)
@@ -1,6 +1,15 @@
 #!/bin/sh -e
 
+BUILDFLAG=""
+
+#BUILDFLAG="--build=i686"
 #export CC="i686-gcc"
+# -mpreferred-stack-boundary=2 can be used to prevent gcc 4.2.x
+# from aligning stack to 16 bytes. (Which is gcc's way of supporting SSE).
+# For me it saves about 6k of text segment.
+# This may be unsafe if your libc expects 16 byte stack alignment
+# on function entry.
+
 export CC="x86_64-gcc"
 
 export CFLAGS="-Os\
@@ -16,5 +25,5 @@ export CFLAGS="-Os\
 "
 
 autoreconf -i -f
-./configure #--enable-maintainer-mode
+./configure $BUILDFLAG #--enable-maintainer-mode
 make CC="$CC" CFLAGS="$CFLAGS"