Skip to content

Commit

Permalink
Update compiler flags and expand Travis build matrix. #31
Browse files Browse the repository at this point in the history
  • Loading branch information
dharple committed Feb 13, 2021
1 parent af33aa3 commit 6265d2b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 5 deletions.
18 changes: 16 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,32 @@ language: c

os: linux

dist: bionic

jobs:
include:
- arch: amd64
compiler: gcc
dist: bionic
- arch: ppc64le
compiler: gcc
dist: bionic
- arch: arm64
compiler: gcc
dist: bionic
- arch: amd64
compiler: clang
dist: bionic
- arch: amd64
compiler: gcc
dist: focal
- arch: amd64
compiler: gcc
dist: xenial
- arch: amd64
compiler: gcc
dist: trusty
- arch: amd64
compiler: gcc
dist: precise

env:
global:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- src/Makefile.am no longer deletes src/config_file.h when `make
maintainer-clean` is run.

### Security
- Added additional compiler protection flags, based on the openSUSE build from
[#31].

## [1.4.0] - 2021-02-11
### Added
- Regression tests for basic functionality, based on old custom scripts.
Expand Down
4 changes: 4 additions & 0 deletions THANKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

*If I missed you, please let me know!*

Hans-Peter Jansen gave me the impetus I needed to finally fix the char /
unsigned char differences throughout the code. Also, he provided a list of
security-based compiler flags.

Mplx let me know that `detox.1` had a typo in the examples.

Daniel Hauck for letting me know that passing `.` as an argument was not
Expand Down
40 changes: 37 additions & 3 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
AM_CFLAGS = -g -O2 -Wall -DYY_NO_INPUT -DYY_NO_UNPUT -DDATADIR=\"$(datadir)\" -DSYSCONFDIR=\"$(sysconfdir)\"
# References and reasons for compiler flags:
#
# https://github.com/dharple/detox/issues/31
# https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
# https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_cjh1548250046139.htm
# https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gcc-part-3/
# https://gcc.gnu.org/onlinedocs/gccint/LTO-Overview.html
#

AM_CFLAGS = \
-DDATADIR=\"$(datadir)\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DYY_NO_INPUT \
-DYY_NO_UNPUT \
-D_FORTIFY_SOURCE=2 \
-Wall \
-Werror=return-type \
-flto=auto \
-fstack-clash-protection \
-fstack-protector-strong

AM_YFLAGS = -d

bin_PROGRAMS = detox inline-detox
detox_SOURCES = detox.c file.c clean_string.c table.c parse_table.c config_file_yacc.y config_file_lex.l config_file_spoof.c config_file_dump.c parse_options.c
bin_PROGRAMS = \
detox \
inline-detox

detox_SOURCES = \
clean_string.c \
config_file_dump.c \
config_file_lex.l \
config_file_spoof.c \
config_file_yacc.y \
detox.c \
file.c \
parse_options.c \
parse_table.c \
table.c

inline_detox_SOURCES = $(detox_SOURCES)

0 comments on commit 6265d2b

Please sign in to comment.