Skip to content

Commit

Permalink
feat(build): disable semantic interposition
Browse files Browse the repository at this point in the history
Tell the compiler to treat symbols marked explicitly as
NCCL_OFI_EXPORT_SYMBOL as preemptible, but not others. This gives the
compiler the freedom to assume that no external LD_PRELOAD'd library can
inject itself as an implementation of any given function in the library,
which means the compiler has the freedom to optimize across function.

Signed-off-by: Nicholas Sielicki <[email protected]>

stack-info: PR: aws#624, branch: aws-nslick/stack/37
  • Loading branch information
aws-nslick committed Sep 26, 2024
1 parent b525063 commit 4f4a1f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,17 @@ AC_C_INLINE
dnl ac_check_enable_debug will make sure AC_PROG_CC doesn't add a
dnl bunch of debugging flags, so there's no ordering requirement
dnl between this and AC_PROG_CC.
AS_IF([test "${ax_enable_debug}" = "no"], [CFLAGS="${CFLAGS} -O3"])
AS_IF([test "${ax_enable_debug}" = "no"], [
dnl Enable O3 optimization
CFLAGS="${CFLAGS} -O3"
dnl dead code elim
CFLAGS="${CFLAGS} -ffunction-sections -fdata-sections"
dnl https://maskray.me/blog/2021-05-09-fno-semantic-interposition
CFLAGS="${CFLAGS} -fno-semantic-interposition -fvisibility=hidden"
LDFLAGS="${LDFLAGS} -Bsymbolic"
])
CHECK_ENABLE_SANITIZER()


Expand Down

0 comments on commit 4f4a1f5

Please sign in to comment.