1 #!/bin/sh -e 2 3 BUILDFLAG="" 4 5 #BUILDFLAG="--build=i686" 6 #export CC="i686-gcc" 7 # -mpreferred-stack-boundary=2 can be used to prevent gcc 4.2.x 8 # from aligning stack to 16 bytes. (Which is gcc's way of supporting SSE). 9 # For me it saves about 6k of text segment. 10 # This may be unsafe if your libc expects 16 byte stack alignment 11 # on function entry. 12 13 export CC="x86_64-gcc" 14 15 export CFLAGS="-Os\ 16 -fomit-frame-pointer\ 17 -static\ 18 -static-libgcc\ 19 -ffunction-sections -fdata-sections\ 20 -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1\ 21 -fno-unwind-tables\ 22 -fno-asynchronous-unwind-tables\ 23 -Wl,--gc-sections\ 24 -Wl,-Map=strace.mapfile\ 25 " 26 27 ./bootstrap 28 ./configure $BUILDFLAG #--enable-maintainer-mode 29 make CC="$CC" CFLAGS="$CFLAGS" 30