Skip to content

Commit de406fb

Browse files
committed
add build note to assembler sources
When distros use the annobin compiler plugin [1], they have complete overview what compiler flags were used for compilation and they are able to perform security checks on the produced binaries. Compiling assembler source can't provide this kind of information by default, so we need the explicit -Wa,--generate-missing-build-notes=yes option during build. When the option is missing, then the annocheck tool reports "GAPS" in the resulting binary. binutils >= 2.31 or older with backport is needed [1] https://fedoraproject.org/wiki/Changes/Annobin Signed-off-by: Dan Horák <dan@danny.cz>
1 parent 1c21758 commit de406fb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,16 @@ if test "x$enable_coverage" = xno && test "x$enable_debug" = xno && test "x$enab
8080
FLAGS="$FLAGS -O3 -D_FORTIFY_SOURCE=2"
8181
fi
8282

83+
# check if assembler can generate missing build notes, binutils >= 2.31 or older with backport is needed
84+
AX_CHECK_COMPILE_FLAG([-Wa,--generate-missing-build-notes=yes], [ICA_ASFLAGS="-Wa,--generate-missing-build-notes=yes"])
85+
8386
# restore cmdline flags (ignore PROG_AS/PROG_CC defaults)
8487
CFLAGS="$cmdline_CFLAGS"
8588
CCASFLAGS="$cmdline_CFLAGS"
8689

8790
AC_SUBST([FLAGS], $FLAGS)
8891
AC_SUBST([LIBS], $LIBS)
92+
AC_SUBST([ICA_ASFLAGS], $ICA_ASFLAGS)
8993
AC_CONFIG_FILES([Makefile doc/Makefile include/Makefile src/Makefile test/Makefile])
9094
AC_OUTPUT
9195

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ lib_LTLIBRARIES = libica.la
88

99
libica_la_CFLAGS = ${AM_CFLAGS} -I${srcdir}/include -I${srcdir}/../include \
1010
-fvisibility=hidden
11-
libica_la_CCASFLAGS = ${AM_CFLAGS}
11+
libica_la_CCASFLAGS = ${AM_CFLAGS} @ICA_ASFLAGS@
1212
libica_la_LIBADD = @LIBS@ -lrt -lcrypto
1313
libica_la_LDFLAGS = -Wl,--version-script=${srcdir}/../libica.map \
1414
-version-number ${VERSION}

0 commit comments

Comments
 (0)