Skip to content

Commit c69c320

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 <[email protected]>
1 parent 9ef8f83 commit c69c320

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

configure.ac

+4
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

libica.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ URL: https://github.com/opencryptoki/libica
99
Source0: %{name}-%{version}.tar.gz
1010
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1111

12-
BuildRequires: autoconf automake libtool openssl-devel
12+
BuildRequires: autoconf automake libtool openssl-devel autoconf-archive
1313

1414
%description
1515
Interface library on Linux for IBM System z to utilize CPACF

src/Makefile.am

+1-1
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)