Skip to content

Commit

Permalink
Add gc-sections
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiming Jing committed Apr 2, 2018
1 parent 10aff8d commit ae76072
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ AS_IF(test x$RUSTC = xno,

AX_COMPILER_VENDOR
OPTIMIZE_CFLAGS="-Os -fvisibility=hidden -ffunction-sections -fdata-sections"
if test x"$ax_cv_c_compiler_vendor" = x"gnu" then
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -Wl,-gc-sections"
elif test x"$ax_cv_c_compiler_vendor" = x"clang" then
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -Wl,-dead-strip"

if test x"$ax_cv_c_compiler_vendor" = x"gnu"
then
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -Wl,--gc-sections"
CARGO_RUSTC_ARGS="-- -C link-args=-Wl,--gc-sections"
fi

if test x"$ax_cv_c_compiler_vendor" = x"clang"
then
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -Wl,-dead_strip"
CARGO_RUSTC_ARGS="-- -C link-args=-Wl,-dead_strip"
fi

DEBUG_CFLAGS="-g -ggdb -O0 -Wall"
Expand Down Expand Up @@ -84,8 +91,6 @@ AC_ARG_ENABLE([rusthost],
[ RUST_HOST= ]
)

CARGO_RUSTC_ARGS="-- -C link-args=-Wl,-gc-sections"

if test "x$RUST_HOST" = "x"
then
CARGO_TARGET_ARGS=""
Expand Down

0 comments on commit ae76072

Please sign in to comment.