blob: 31ee264f89ddc7fca65577d1b3ed8a709d3f4c72 [file] [log] [blame]
Denys Vlasenko6e5f5b32013-03-22 15:59:01 +01001#!/bin/sh -e
2
Denys Vlasenkoaeb6e302013-06-26 15:07:23 +02003BUILDFLAG=""
4
5#BUILDFLAG="--build=i686"
Denys Vlasenko6e5f5b32013-03-22 15:59:01 +01006#export CC="i686-gcc"
Denys Vlasenkoaeb6e302013-06-26 15:07:23 +02007# -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 Vlasenko6e5f5b32013-03-22 15:59:01 +010013export CC="x86_64-gcc"
14
15export 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. Levin3e69bdf2014-04-25 22:52:06 +000027./bootstrap
Denys Vlasenkoaeb6e302013-06-26 15:07:23 +020028./configure $BUILDFLAG #--enable-maintainer-mode
Denys Vlasenko6e5f5b32013-03-22 15:59:01 +010029make CC="$CC" CFLAGS="$CFLAGS"