Denys Vlasenko | 6e5f5b3 | 2013-03-22 15:59:01 +0100 | [diff] [blame] | 1 | #!/bin/sh -e |
| 2 | |
Denys Vlasenko | aeb6e30 | 2013-06-26 15:07:23 +0200 | [diff] [blame] | 3 | BUILDFLAG="" |
| 4 | |
| 5 | #BUILDFLAG="--build=i686" |
Denys Vlasenko | 6e5f5b3 | 2013-03-22 15:59:01 +0100 | [diff] [blame] | 6 | #export CC="i686-gcc" |
Denys Vlasenko | aeb6e30 | 2013-06-26 15:07:23 +0200 | [diff] [blame] | 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 | |
Denys Vlasenko | 6e5f5b3 | 2013-03-22 15:59:01 +0100 | [diff] [blame] | 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 | |
Dmitry V. Levin | 3e69bdf | 2014-04-25 22:52:06 +0000 | [diff] [blame] | 27 | ./bootstrap |
Denys Vlasenko | aeb6e30 | 2013-06-26 15:07:23 +0200 | [diff] [blame] | 28 | ./configure $BUILDFLAG #--enable-maintainer-mode |
Denys Vlasenko | 6e5f5b3 | 2013-03-22 15:59:01 +0100 | [diff] [blame] | 29 | make CC="$CC" CFLAGS="$CFLAGS" |