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
26419a7a
Commit
26419a7a
authored
Oct 21, 2016
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use libtool for liblxc.so
This should allow proper filtering of build flags for libraries and make it easier to use PIE/PIC. Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
4ab12dac
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
70 additions
and
29 deletions
+70
-29
Makefile.am
Makefile.am
+4
-0
autogen.sh
autogen.sh
+1
-0
configure.ac
configure.ac
+14
-2
Makefile.am
src/lua-lxc/Makefile.am
+13
-6
Makefile.am
src/lxc/Makefile.am
+19
-18
version.h.in
src/lxc/version.h.in
+1
-1
Makefile.am
src/python-lxc/Makefile.am
+1
-1
setup.py
src/python-lxc/setup.py
+16
-0
Makefile.am
src/tests/Makefile.am
+1
-1
No files found.
Makefile.am
View file @
26419a7a
...
...
@@ -2,6 +2,7 @@
ACLOCAL_AMFLAGS
=
-I
config
LIBTOOL_DEPS
=
@LIBTOOL_DEPS@
SUBDIRS
=
config src templates doc hooks
DIST_SUBDIRS
=
config src templates doc hooks
EXTRA_DIST
=
\
...
...
@@ -23,6 +24,9 @@ endif
pcdatadir
=
$(libdir)
/pkgconfig
pcdata_DATA
=
lxc.pc
libtool
:
$(LIBTOOL_DEPS)
$(SHELL)
./config.status libtool
install-data-local
:
$(MKDIR_P)
$(DESTDIR)$(LXCPATH)
$(MKDIR_P)
$(DESTDIR)$(localstatedir)
/cache/lxc
...
...
autogen.sh
View file @
26419a7a
...
...
@@ -24,6 +24,7 @@
set
-x
test
-d
autom4te.cache
&&
rm
-rf
autom4te.cache
libtoolize
||
exit
1
aclocal
-I
config
||
exit
1
autoheader
||
exit
1
autoconf
||
exit
1
...
...
configure.ac
View file @
26419a7a
...
...
@@ -6,7 +6,11 @@ m4_define([lxc_version_major], 2)
m4_define([lxc_version_minor], 0)
m4_define([lxc_version_micro], 0)
m4_define([lxc_version_beta], [])
m4_define([lxc_version_abi], 1.2.0)
m4_define([lxc_abi_major], 1)
m4_define([lxc_abi_minor], 2)
m4_define([lxc_abi_micro], 0)
m4_define([lxc_abi], [lxc_abi_major.lxc_abi_minor.lxc_abi_micro])
m4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
m4_define([lxc_version],
...
...
@@ -23,10 +27,14 @@ AC_SUBST(LXC_VERSION_BETA, lxc_version_beta)
AC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major])
AC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor])
AC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro])
AC_SUBST([LXC_VERSION_ABI], [lxc_version_abi])
AC_SUBST([LXC_VERSION], [lxc_version])
AC_SUBST([LXC_DEVEL], [lxc_devel])
AC_SUBST([LXC_ABI_MAJOR], [lxc_abi_major])
AC_SUBST([LXC_ABI_MINOR], [lxc_abi_minor])
AC_SUBST([LXC_ABI_MICRO], [lxc_abi_micro])
AC_SUBST([LXC_ABI], [lxc_abi])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([src/config.h])
...
...
@@ -35,6 +43,10 @@ AC_CANONICAL_HOST
AM_PROG_CC_C_O
AC_GNU_SOURCE
# libtool
LT_INIT
AC_SUBST([LIBTOOL_DEPS])
# Detect the distribution. This is used for the default configuration and
# for some distro-specific build options.
AC_MSG_CHECKING([host distribution])
...
...
src/lua-lxc/Makefile.am
View file @
26419a7a
...
...
@@ -7,20 +7,27 @@ sodir=$(lualibdir)/lxc
lua_DATA
=
lxc.lua
so_PROGRAMS
=
core.so
core_so_SOURCES
=
core.c
lib_LTLIBRARIES
=
libcore.la
libcore_la_SOURCES
=
core.c
AM_CFLAGS
=
-I
$(top_builddir)
/src
-I
$(top_srcdir)
/src
$(LUA_CFLAGS)
-DVERSION
=
\"
$(VERSION)
\"
-DLXCPATH
=
\"
$(LXCPATH)
\"
core_so
_CFLAGS
=
-fPIC
-DPIC
$(AM_CFLAGS)
libcore_la
_CFLAGS
=
-fPIC
-DPIC
$(AM_CFLAGS)
core_so
_LDFLAGS
=
\
libcore_la
_LDFLAGS
=
\
-shared
\
-L
$(top_builddir)
/src/lxc
\
-Wl
,-soname,core.so.
$
(
firstword
$
(
subst ., ,
$(VERSION)
))
core_so_LDADD
=
-llxc
libcore_la_LIBADD
=
-llxc
install-exec-local
:
install-libLTLIBRARIES
mkdir
-p
$(DESTDIR)$(lualibdir)
/lxc/
mv
$(DESTDIR)$(libdir)
/libcore.so.0.0.0
$(DESTDIR)$(lualibdir)
/lxc/core.so
rm
$(DESTDIR)$(libdir)
/libcore.
*
uninstall-local
:
$(RM)
$(DESTDIR)$(lualibdir)
/lxc/core.so
*
lxc.lua
:
...
...
src/lxc/Makefile.am
View file @
26419a7a
...
...
@@ -53,8 +53,6 @@ noinst_HEADERS += ../include/getsubopt.h
endif
sodir
=
$(libdir)
# use PROGRAMS to avoid complains from automake
so_PROGRAMS
=
liblxc.so
LSM_SOURCES
=
\
lsm/nop.c
\
...
...
@@ -68,7 +66,8 @@ if ENABLE_SELINUX
LSM_SOURCES
+=
lsm/selinux.c
endif
liblxc_so_SOURCES
=
\
lib_LTLIBRARIES
=
liblxc.la
liblxc_la_SOURCES
=
\
arguments.c arguments.h
\
bdev/bdev.c bdev/bdev.h
\
bdev/lxcaufs.c bdev/lxcaufs.h
\
...
...
@@ -123,11 +122,11 @@ liblxc_so_SOURCES = \
$(LSM_SOURCES)
if
ENABLE_CGMANAGER
liblxc_
so
_SOURCES
+=
cgroups/cgmanager.c
liblxc_
la
_SOURCES
+=
cgroups/cgmanager.c
endif
if
IS_BIONIC
liblxc_
so
_SOURCES
+=
\
liblxc_
la
_SOURCES
+=
\
../include/ifaddrs.c ../include/ifaddrs.h
\
../include/openpty.c ../include/openpty.h
\
../include/lxcmntent.c ../include/lxcmntent.h
...
...
@@ -135,7 +134,7 @@ endif
if
!HAVE_GETLINE
if
HAVE_FGETLN
liblxc_
so
_SOURCES
+=
../include/getline.c ../include/getline.h
liblxc_
la
_SOURCES
+=
../include/getline.c ../include/getline.h
endif
endif
...
...
@@ -176,21 +175,22 @@ endif
if
ENABLE_SECCOMP
AM_CFLAGS
+=
-DHAVE_SECCOMP
$(SECCOMP_CFLAGS)
liblxc_
so
_SOURCES
+=
seccomp.c
liblxc_
la
_SOURCES
+=
seccomp.c
endif
liblxc_
so
_CFLAGS
=
-fPIC
-DPIC
$(AM_CFLAGS)
-pthread
liblxc_
la
_CFLAGS
=
-fPIC
-DPIC
$(AM_CFLAGS)
-pthread
liblxc_
so
_LDFLAGS
=
\
liblxc_
la
_LDFLAGS
=
\
-pthread
\
-shared
\
-Wl
,-soname,liblxc.so.
$
(
firstword
$
(
subst ., ,@LXC_VERSION_ABI@
))
-Wl
,-soname,liblxc.so.
$
(
firstword
$
(
subst ., ,@LXC_ABI@
))
\
-version-info
@LXC_ABI_MAJOR@
liblxc_
so_LD
ADD
=
$(CAP_LIBS)
$(APPARMOR_LIBS)
$(SELINUX_LIBS)
$(SECCOMP_LIBS)
liblxc_
la_LIB
ADD
=
$(CAP_LIBS)
$(APPARMOR_LIBS)
$(SELINUX_LIBS)
$(SECCOMP_LIBS)
if
ENABLE_CGMANAGER
liblxc_
so_LD
ADD
+=
$(CGMANAGER_LIBS)
$(DBUS_LIBS)
$(NIH_LIBS)
$(NIH_DBUS_LIBS)
liblxc_
so
_CFLAGS
+=
$(CGMANAGER_CFLAGS)
$(DBUS_CFLAGS)
$(NIH_CFLAGS)
$(NIH_DBUS_CFLAGS)
liblxc_
la_LIB
ADD
+=
$(CGMANAGER_LIBS)
$(DBUS_LIBS)
$(NIH_LIBS)
$(NIH_DBUS_LIBS)
liblxc_
la
_CFLAGS
+=
$(CGMANAGER_CFLAGS)
$(DBUS_CFLAGS)
$(NIH_CFLAGS)
$(NIH_DBUS_CFLAGS)
endif
bin_SCRIPTS
=
tools/lxc-checkconfig
...
...
@@ -242,7 +242,7 @@ AM_LDFLAGS = -Wl,-E
if
ENABLE_RPATH
AM_LDFLAGS
+=
-Wl
,-rpath
-Wl
,
$(libdir)
endif
LDADD
=
liblxc.
so
@CAP_LIBS@ @APPARMOR_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
LDADD
=
liblxc.
la
@CAP_LIBS@ @APPARMOR_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
lxc_attach_SOURCES
=
tools/lxc_attach.c
lxc_autostart_SOURCES
=
tools/lxc_autostart.c
...
...
@@ -295,13 +295,14 @@ init_lxc_static_LDADD = @CAP_LIBS@
init_lxc_static_CFLAGS
=
$(AM_CFLAGS)
-DNO_LXC_CONF
endif
install-exec-local
:
install-
soPROGRAM
S
install-exec-local
:
install-
libLTLIBRARIE
S
mkdir
-p
$(DESTDIR)$(datadir)
/lxc
install
-c
-m
644 lxc.functions
$(DESTDIR)$(datadir)
/lxc
mv
$(DESTDIR)$(libdir)
/liblxc.so
$(DESTDIR)$(libdir)
/liblxc.so.@LXC_VERSION_ABI@
rm
$(DESTDIR)$(libdir)
/liblxc.so
$(DESTDIR)$(libdir)
/liblxc.so.1
mv
$(DESTDIR)$(libdir)
/liblxc.so.1.0.0
$(DESTDIR)$(libdir)
/liblxc.so.@LXC_ABI@
cd
$(DESTDIR)$(libdir)
;
\
ln
-sf
liblxc.so.@LXC_
VERSION_ABI@ liblxc.so.
$
(
firstword
$
(
subst ., ,@LXC_VERSION
_ABI@
))
;
\
ln
-sf
liblxc.so.
$
(
firstword
$
(
subst ., ,@LXC_
VERSION_
ABI@
))
liblxc.so
ln
-sf
liblxc.so.@LXC_
ABI@ liblxc.so.
$
(
firstword
$
(
subst ., ,@LXC
_ABI@
))
;
\
ln
-sf
liblxc.so.
$
(
firstword
$
(
subst ., ,@LXC_ABI@
))
liblxc.so
install-exec-hook
:
chmod
u+s
$(DESTDIR)$(libexecdir)
/lxc/lxc-user-nic
...
...
src/lxc/version.h.in
View file @
26419a7a
...
...
@@ -27,7 +27,7 @@
#define LXC_VERSION_MAJOR @LXC_VERSION_MAJOR@
#define LXC_VERSION_MINOR @LXC_VERSION_MINOR@
#define LXC_VERSION_MICRO @LXC_VERSION_MICRO@
#define LXC_VERSION_ABI "@LXC_
VERSION_
ABI@"
#define LXC_VERSION_ABI "@LXC_ABI@"
#define LXC_VERSION "@LXC_VERSION@"
#endif
src/python-lxc/Makefile.am
View file @
26419a7a
...
...
@@ -15,7 +15,7 @@ endif
CALL_SETUP_PY
:=
cd
@srcdir@
&&
$(PYTHON)
setup.py build
-b
@abs_builddir@/build egg_info
-e
@abs_builddir@
all
:
$(CALL_SETUP_PY)
build_ext
-I
@abs_top_srcdir@/src
-L
@abs_top_builddir@/src/lxc
$(RPATHOPTS)
--no-pkg-config
$(CALL_SETUP_PY)
build_ext
-I
@abs_top_srcdir@/src
-L
@abs_top_builddir@/src/lxc
/.libs/
$(RPATHOPTS)
--no-pkg-config
DESTDIR
=
/
# default
...
...
src/python-lxc/setup.py
View file @
26419a7a
...
...
@@ -28,6 +28,22 @@ import subprocess
from
setuptools
import
setup
,
Extension
from
setuptools.command.build_ext
import
build_ext
as
BuildExtCommand
# Fix build when PIE is enabled
for
var
in
(
"LDFLAGS"
,
"CFLAGS"
):
current
=
os
.
environ
.
get
(
var
,
None
)
if
not
current
:
continue
new
=
[]
for
flag
in
current
.
split
(
" "
):
if
flag
.
lower
()
in
(
"-pie"
,
"-fpie"
):
if
"-fPIC"
not
in
new
:
new
.
append
(
"-fPIC"
)
continue
new
.
append
(
flag
)
os
.
environ
[
var
]
=
" "
.
join
(
new
)
class
LxcBuildExtCommand
(
BuildExtCommand
):
user_options
=
BuildExtCommand
.
user_options
+
[
...
...
src/tests/Makefile.am
View file @
26419a7a
if
ENABLE_TESTS
LDADD
=
../lxc/liblxc.
so
LDADD
=
../lxc/liblxc.
la
lxc_test_containertests_SOURCES
=
containertests.c
lxc_test_locktests_SOURCES
=
locktests.c
...
...
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