gcc 1.34 KB
Newer Older
jberryman's avatar
jberryman committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/bin/bash

#
#    - Try to silence LTO type error:  -Wno-lto-type-mismatch
#    - -fno-semantic-interposition , but see:
#         $ ack HAS_VISIBILITY_HIDDEN -A4
#         $ ack RTS_PRIVATE
#         $ ack 'visibility.*default'
#       It looks like these annotations are pretty sparse so maybe good idea!
#         https://kristerw.blogspot.com/2016/11/inlining-shared-libraries-are-special.html
#         https://stackoverflow.com/questions/35745543/new-option-in-gcc-5-3-fno-semantic-interposition
#    - add (maybe pointless) -O2 -Wl,-O2  for link/compile in built binaries
#        These should be unnecessary, at least in later gccs...
#    - add -Wno-sync-nand
#         See note in: libraries/ghc-prim/cbits/atomic.c
#         - this seems to do nothing... nor -Wno-error ...
##   NOTE! with -fno-fat-lto-objects (but with LTO) we erroneously get ".subsections_via_symbols... yes" in configure
exec /usr/bin/gcc -Wno-sync-nand -O2 -Wl,-O2 -grecord-gcc-switches  -fno-semantic-interposition -Wno-lto-type-mismatch -flto -fno-fat-lto-objects -g1 -time=/tmp/gcc_lto_shim_build.nofat3.hello  ${1+"$@"} 
# NOTE: Use -ffat-lto-objects instead to (hopefully) create e.g. a bindist that
#       will work normally if the user doesn't have a working gcc LTO setup
#         We use nofat above so that things don't just quietly work when LTO is
#       misconfigured/fubar