Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build_static_example.sh 746B

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