Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
12cf9f5a
Unverified
Commit
12cf9f5a
authored
Apr 21, 2021
by
Christian Brauner
Committed by
GitHub
Apr 21, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3801 from evverx/san-tweaks
ci: make use of --enable-sanitizers instead of CFLAGS
parents
6622f651
d480165a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
17 deletions
+5
-17
sanitizers.sh
.github/workflows/sanitizers.sh
+1
-11
attributes.m4
config/attributes.m4
+1
-1
configure.ac
configure.ac
+0
-5
Makefile.am
src/lxc/Makefile.am
+3
-0
No files found.
.github/workflows/sanitizers.sh
View file @
12cf9f5a
...
@@ -20,18 +20,8 @@ apt-get install --yes --no-install-recommends \
...
@@ -20,18 +20,8 @@ apt-get install --yes --no-install-recommends \
python3-setuptools rsync squashfs-tools uidmap unzip uuid-runtime
\
python3-setuptools rsync squashfs-tools uidmap unzip uuid-runtime
\
wget xz-utils
wget xz-utils
# init.lxc.static is run in arbitrary containers where the libasan library lxc has been built with
# isn't always installed. To make it work let's override GCC's default and link both libasan
# and libubsan statically. It should help to fix issues like
# ...
# ++ lxc-execute -n c1 -- sudo -u ubuntu /nnptest
# lxc-init: error while loading shared libraries: libasan.so.5: cannot open shared object file: No such file or directory
if
[[
"
$CC
"
==
"gcc"
]]
;
then
sed
-i
'/init_lxc_static_LDFLAGS/s/$/ -static-libasan -static-libubsan/'
src/lxc/Makefile.am
fi
./autogen.sh
./autogen.sh
CFLAGS
=
"-Wall -Werror
-fsanitize=address,undefined"
./configure
--enable-tests
--prefix
=
/usr/
--sysconfdir
=
/etc/
--localstatedir
=
/var/
--disable-no-undefined
CFLAGS
=
"-Wall -Werror
"
./configure
--enable-sanitizers
--enable-tests
--prefix
=
/usr/
--sysconfdir
=
/etc/
--localstatedir
=
/var/
--disable-no-undefined
make
make
make
install
make
install
...
...
config/attributes.m4
View file @
12cf9f5a
...
@@ -70,7 +70,7 @@ AC_DEFUN([CC_CHECK_LDFLAGS], [
...
@@ -70,7 +70,7 @@ AC_DEFUN([CC_CHECK_LDFLAGS], [
AS_TR_SH([cc_cv_ldflags_$1]),
AS_TR_SH([cc_cv_ldflags_$1]),
[ac_save_LDFLAGS="$LDFLAGS"
[ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $1"
LDFLAGS="$LDFLAGS $1"
AC_LINK_IFELSE([
int main() { return 1; }
],
AC_LINK_IFELSE([
AC_LANG_SOURCE([int main() { return 1; }])
],
[eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
[eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
[eval "AS_TR_SH([cc_cv_ldflags_$1])="])
[eval "AS_TR_SH([cc_cv_ldflags_$1])="])
LDFLAGS="$ac_save_LDFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
...
...
configure.ac
View file @
12cf9f5a
...
@@ -471,11 +471,6 @@ if test "x$enable_sanitizers" = "xyes"; then
...
@@ -471,11 +471,6 @@ if test "x$enable_sanitizers" = "xyes"; then
-fno-omit-frame-pointer])
-fno-omit-frame-pointer])
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CFLAGS)
CC_CHECK_FLAGS_APPEND([AM_LDFLAGS],[LDFLAGS],[ \
-fsanitize=address])
AC_SUBST(AM_LDFLAGS)
AC_MSG_RESULT([yes])
AC_MSG_RESULT([yes])
else
else
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
...
...
src/lxc/Makefile.am
View file @
12cf9f5a
...
@@ -1827,6 +1827,9 @@ endif
...
@@ -1827,6 +1827,9 @@ endif
init_lxc_static_LDFLAGS
=
-all-static
-pthread
init_lxc_static_LDFLAGS
=
-all-static
-pthread
init_lxc_static_LDADD
=
@CAP_LIBS@
init_lxc_static_LDADD
=
@CAP_LIBS@
init_lxc_static_CFLAGS
=
$(AM_CFLAGS)
-DNO_LXC_CONF
init_lxc_static_CFLAGS
=
$(AM_CFLAGS)
-DNO_LXC_CONF
if
ENABLE_SANITIZERS
init_lxc_static_CFLAGS
+=
-fno-sanitize
=
address,undefined
endif
endif
endif
endif
endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment