mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-03-11 06:37:31 +00:00
format-security warns of usage such as `printf(x)`, which is usually a security hole. int-conversion is very useful to find cases such as ``` error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion] msg = strerror_r(errnum, buf, buflen); ``` where the usage of things like the wrong strerror_r are legitimate errors in the application that cause it to crash. it makes more sense for the compiler to reject it instead, and this does that.
44 lines
1.4 KiB
Plaintext
44 lines
1.4 KiB
Plaintext
export CFLAGS="-Os -fomit-frame-pointer -Werror=format-security -Werror=int-conversion"
|
|
export CXXFLAGS="$CFLAGS"
|
|
export CPPFLAGS="$CFLAGS"
|
|
export LDFLAGS="-Wl,--as-needed,-O1,--sort-common"
|
|
export GOFLAGS="-buildmode=pie -modcacherw -trimpath -buildvcs=false"
|
|
# Do note that these should work with at least GDC and LDC
|
|
export DFLAGS="-Os"
|
|
|
|
export JOBS=$(nproc)
|
|
export MAKEFLAGS=-j$JOBS
|
|
export SAMUFLAGS=-j$JOBS
|
|
export CARGO_BUILD_JOBS=$JOBS
|
|
export CTEST_PARALLEL_LEVEL=$JOBS
|
|
|
|
export CARGO_PROFILE_RELEASE_OPT_LEVEL="s"
|
|
export CARGO_PROFILE_RELEASE_PANIC="abort"
|
|
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
|
|
export CARGO_PROFILE_RELEASE_LTO="true"
|
|
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
|
|
|
|
# remove line below to disable colors
|
|
USE_COLORS=1
|
|
|
|
# uncomment line below to enable ccache support.
|
|
#USE_CCACHE=1
|
|
|
|
SRCDEST=/var/cache/distfiles
|
|
|
|
# uncomment line below to store built packages in other location
|
|
# The package will be stored as $REPODEST/$repo/$pkgname-$pkgver-r$pkgrel.apk
|
|
# where $repo is the name of the parent directory of $startdir.
|
|
REPODEST=$HOME/packages/
|
|
|
|
# PACKAGER and MAINTAINER are used by newapkbuild when creating new aports for
|
|
# the APKBUILD's "Contributor:" and "Maintainer:" comments, respectively.
|
|
#PACKAGER="Your Name <your@email.address>"
|
|
#MAINTAINER="$PACKAGER"
|
|
|
|
# what to clean up after a successful build
|
|
CLEANUP="srcdir bldroot pkgdir deps"
|
|
|
|
# what to cleanup after a failed build
|
|
ERROR_CLEANUP="bldroot deps"
|