Skip to content

Commit

Permalink
build: undefine "mips" to prevent build problems for MIPS targets
Browse files Browse the repository at this point in the history
It turns out that the MIPS GCC compiler defines a "mips" cpp macro
which was resulting in build failures on MIPS so we need to
undefine the "mips" macro during build.  As this should be safe
to do in all architectures, just add it to the compiler flags by
default.

This was reported in the following GH issue:
* #274

Reported-by: Rongwei Zhang <pudh4418@gmail.com>
Suggested-by: Rongwei Zhang <pudh4418@gmail.com>
Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
(imported from commit 5cd9059)
  • Loading branch information
pcmoore committed Oct 25, 2020
1 parent d9cdb27 commit 3e1a828
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

dnl ####
dnl build flags
dnl NOTE: the '-Umips' is here because MIPS GCC compilers "helpfully" define it
dnl for us which wreaks havoc on the build
dnl ####
AM_CPPFLAGS="-I\${top_srcdir}/include -I\${top_builddir}/include"
AM_CFLAGS="-Wall"
AM_CFLAGS="-Wall -Umips"
AM_LDFLAGS="-Wl,-z -Wl,relro"
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ lib_LTLIBRARIES = libseccomp.la
arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ALL}

arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL}
arch_syscall_check_CFLAGS = ${CODE_COVERAGE_CFLAGS}
arch_syscall_check_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS}
arch_syscall_check_LDFLAGS = ${CODE_COVERAGE_LDFLAGS}

libseccomp_la_SOURCES = ${SOURCES_ALL}
Expand Down

0 comments on commit 3e1a828

Please sign in to comment.