Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 132126 - sys-fs/cryptsetup-luks-1.0.3 fails to compile static on selinux system
Summary: sys-fs/cryptsetup-luks-1.0.3 fails to compile static on selinux system
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Benjamin Smee (strerror) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-03 07:01 UTC by Chris PeBenito (RETIRED)
Modified: 2006-08-07 19:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cryptsetup-luks-1.0.3-selinux.patch (cryptsetup-luks-1.0.3-selinux.patch,463 bytes, patch)
2006-05-24 04:35 UTC, Sascha G.
Details | Diff
cryptsetup-luks-1.0.3.ebuild.patch (EBUILD.PATCH,843 bytes, patch)
2006-05-24 04:37 UTC, Sascha G.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris PeBenito (RETIRED) gentoo-dev 2006-05-03 07:01:01 UTC
Fails to compile static:

i686-pc-linux-gnu-gcc -march=pentium4 -O2 -maccumulate-outgoing-args -fforce-addr -fomit-frame-pointer -frename-registers -pipe -o cryptsetup -static cryptsetup.o  /usr/lib/libpopt.a ../lib/.libs/libcryptsetup.a -ldevmapper -lselinux /usr/lib/libgcrypt.a -lnsl /usr/lib/libgpg-error.a -luuid
/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../libselinux.a(load_policy.o): In function `selinux_mkload_policy':
load_policy.c:(.text+0xc2): undefined reference to `sepol_policy_kern_vers_max'
load_policy.c:(.text+0x140): undefined reference to `sepol_policy_kern_vers_min'
load_policy.c:(.text+0x278): undefined reference to `sepol_policy_file_create'
load_policy.c:(.text+0x28f): undefined reference to `sepol_policydb_create'
load_policy.c:(.text+0x2a1): undefined reference to `sepol_policy_file_free'
load_policy.c:(.text+0x2c8): undefined reference to `sepol_policy_file_set_mem'
load_policy.c:(.text+0x2e0): undefined reference to `sepol_policydb_read'
load_policy.c:(.text+0x2f2): undefined reference to `sepol_policy_file_free'
load_policy.c:(.text+0x300): undefined reference to `sepol_policydb_free'
load_policy.c:(.text+0x31a): undefined reference to `sepol_policydb_set_vers'
load_policy.c:(.text+0x348): undefined reference to `sepol_policydb_to_image'
load_policy.c:(.text+0x35c): undefined reference to `sepol_policy_file_free'
load_policy.c:(.text+0x36a): undefined reference to `sepol_policydb_free'
load_policy.c:(.text+0x3a8): undefined reference to `sepol_policy_file_free'
load_policy.c:(.text+0x3b6): undefined reference to `sepol_policydb_free'
load_policy.c:(.text+0x412): undefined reference to `sepol_genusers'
load_policy.c:(.text+0x549): undefined reference to `sepol_genbools_array'
load_policy.c:(.text+0x5d1): undefined reference to `sepol_genbools'
collect2: ld returned 1 exit status

Adding -lsepol will fix this.  Libselinux depends on libsepol.  Probably should also add sys-libs/libselinux as a dependency if USE=selinux.
Comment 1 Sascha G. 2006-05-24 04:35:08 UTC
Created attachment 87380 [details, diff]
cryptsetup-luks-1.0.3-selinux.patch

I have no idea if this is the right way to do it, but at least it compiles and runs with this patch. :-)
Comment 2 Sascha G. 2006-05-24 04:37:16 UTC
Created attachment 87381 [details, diff]
cryptsetup-luks-1.0.3.ebuild.patch
Comment 3 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2006-05-31 02:20:15 UTC
thanks for patch. in cvs now and i've added a pic USE flag. I had someone test it and it all compiled fine, but further testing would be appreciated.
Comment 4 Andreas Korinek 2006-05-31 11:33:52 UTC
This does not build on amd64 per default (use -pic).

/bin/sh ../libtool --mode=link x86_64-pc-linux-gnu-gcc  -O3 -march=k8 -mfpmath=sse,387 -mmmx -msse -msse2 -msse3 -m3dnow -pipe -fomit-frame-pointer   -o libcryptsetup.la -rpath /usr/lib64  setup.lo utils.lo backends.lo libdevmapper.lo gcrypt.lo -ldevmapper  -L/usr/lib64 -lgcrypt -L/usr/lib64 -lgpg-error -luuid ../luks/libluks.la
x86_64-pc-linux-gnu-gcc -shared  .libs/setup.o .libs/utils.o .libs/backends.o .libs/libdevmapper.o .libs/gcrypt.o -Wl,--whole-archive ../luks/.libs/libluks.a -Wl,--no-whole-archive  -ldevmapper -L/usr/lib64 /usr/lib64/libgcrypt.so /usr/lib64/libgpg-error.so -luuid  -march=k8 -mfpmath=sse,387 -mmmx -msse -msse2 -msse3 -m3dnow -Wl,-soname -Wl,libcryptsetup.so.0 -o .libs/libcryptsetup.so.0.0.0
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/setup.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
.libs/setup.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

Comment 5 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2006-06-01 04:04:34 UTC
there's a new version in cvs.
Comment 6 SpanKY gentoo-dev 2006-08-07 19:32:49 UTC
uhh, you arent supposed to be using the pic USE flag

if you "need" it, then your package is broken