Skip to content

Commit 0e4592f

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 50f9007 commit 0e4592f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

configure.ac

+4
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,16 @@ if test "x$enable_coverage" = xno && test "x$enable_debug" = xno && test "x$enab
9999
FLAGS="$FLAGS -O3 -D_FORTIFY_SOURCE=2"
100100
fi
101101

102+
# check if assembler can generate missing build notes, binutils >= 2.31 or older with backport is needed
103+
AX_CHECK_COMPILE_FLAG([-Wa,--generate-missing-build-notes=yes], [ICA_ASFLAGS="-Wa,--generate-missing-build-notes=yes"])
104+
102105
# restore cmdline flags (ignore PROG_AS/PROG_CC defaults)
103106
CFLAGS="$cmdline_CFLAGS"
104107
CCASFLAGS="$cmdline_CFLAGS"
105108

106109
AC_SUBST([FLAGS], $FLAGS)
107110
AC_SUBST([LIBS], $LIBS)
111+
AC_SUBST([ICA_ASFLAGS], $ICA_ASFLAGS)
108112
AC_CONFIG_FILES([Makefile doc/Makefile include/Makefile src/Makefile test/Makefile])
109113
AC_OUTPUT
110114

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ SOURCES_common = ica_api.c init.c icastats_shared.c s390_rsa.c \
3030
include/rng.h
3131

3232
libica_la_CFLAGS = ${CFLAGS_common} -DLIBNAME=\"libica\"
33-
libica_la_CCASFLAGS = ${AM_CFLAGS}
33+
libica_la_CCASFLAGS = ${AM_CFLAGS} ${ICA_ASFLAGS}
3434
libica_la_LIBADD = ${LIBS_common}
3535
libica_la_LDFLAGS = ${LDFLAGS_common}
3636
libica_la_SOURCES = ${SOURCES_common}
3737

3838
libica_cex_la_CFLAGS = ${CFLAGS_common} -DNO_CPACF -DNO_SW_FALLBACKS -DLIBNAME=\"libica-cex\"
39-
libica_cex_la_CCASFLAGS = ${AM_CFLAGS}
39+
libica_cex_la_CCASFLAGS = ${AM_CFLAGS} ${ICA_ASFLAGS}
4040
libica_cex_la_LIBADD = ${LIBS_common}
4141
libica_cex_la_LDFLAGS = ${LDFLAGS_common}
4242
libica_cex_la_SOURCES = ${SOURCES_common}

0 commit comments

Comments
 (0)