libsepol: Fix build for Android.
PATCH 1/1 libsepol: Fix build for Android.
The Android build does not like the symbol versioning introduced
by commit 8147bc7; the build fails with:
host SharedLib: libsepol (out/host/linux-x86/obj/lib/libsepol.so) prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: symbol cil_build_policydb has undefined version prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: symbol cil_build_policydb has undefined version LIBSEPOL_1.1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The simplest fix appears to be to just drop the symver entries when building on Android.
--- libsepol/Android.mk | 1 + libsepol/cil/src/cil.c | 2 ++ 2 files changed, 3 insertions(+)
libsepol/Android.mk +1 -0
@@ -62,6 +62,7 @@ cil_src_files := \ cil/src/cil_verify.c common_cflags := \ + -D_ANDROID_ \ -Wall -W -Wundef \ -Wshadow -Wmissing-noreturn \ -Wmissing-format-attribute
libsepol/cil/src/cil.c +2 -0
@@ -51,6 +51,7 @@#include "cil_policy.h" #include "cil_strpool.h" +#ifndef _ANDROID_ asm(".symver cil_build_policydb_pdb, cil_build_policydb@" ); asm(".symver cil_build_policydb_create_pdb, cil_build_policydb@@LIBSEPOL_1.1" );
@@ -65,6 +66,7 @@ asm(".symver cil_selinuxusers_to_string_nopdb, cil_selinuxusers_to_string@@LIBSE asm(".symver cil_filecons_to_string_pdb, cil_filecons_to_string@" ); asm(".symver cil_filecons_to_string_nopdb, cil_filecons_to_string@@LIBSEPOL_1.1" ); +#endif int cil_sym_sizes[CIL_SYM_ARRAY_NUM ][CIL_SYM_NUM ] = { {64 ,64 ,64 ,1 <<13 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 },
Signature · 1 line
1.9.3
Quoted 56 lines · Stephen Smalley
The Android build does not like the symbol versioning introduced
by commit 8147bc7; the build fails with:
host SharedLib: libsepol (out/host/linux-x86/obj/lib/libsepol.so) prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: symbolcil_build_policydbhas undefined version prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: symbolcil_build_policydbhas undefined version LIBSEPOL_1.1
clang: error: linker command failed with exit code 1 (use -v to see invocation)The simplest fix appears to be to just drop the symver entries when building on Android.
Signed-off-by Stephen Smalley <[email protected]>--- libsepol/Android.mk | 1 + libsepol/cil/src/cil.c | 2 ++ 2 files changed, 3 insertions(+)libsepol/Android.mk +1
-0@@ -62,6 +62,7 @@ cil_src_files := \ cil/src/cil_verify.c common_cflags := \ + -D_ANDROID_ \ -Wall -W -Wundef \ -Wshadow -Wmissing-noreturn \ -Wmissing-format-attributelibsepol/cil/src/cil.c +2
-1@@ -51,6 +51,7 @@#include "cil_policy.h" #include "cil_strpool.h" +#ifndef _ANDROID_ asm(".symver cil_build_policydb_pdb, cil_build_policydb@" ); asm(".symver cil_build_policydb_create_pdb, cil_build_policydb@@LIBSEPOL_1.1" );@@ -65,6 +66,7 @@ asm(".symver cil_selinuxusers_to_string_nopdb, cil_selinuxusers_to_string@@LIBSE asm(".symver cil_filecons_to_string_pdb, cil_filecons_to_string@" ); asm(".symver cil_filecons_to_string_nopdb, cil_filecons_to_string@@LIBSEPOL_1.1" ); +#endif int cil_sym_sizes[CIL_SYM_ARRAY_NUM ][CIL_SYM_NUM ] = { {64 ,64 ,64 ,1 <<13 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 }, --1.9.3
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].
Quoted 21 lines · Stephen Smalley
The Android build does not like the symbol versioning introduced
by commit 8147bc7; the build fails with:
host SharedLib: libsepol (out/host/linux-x86/obj/lib/libsepol.so) prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: symbolcil_build_policydbhas undefined version prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: symbolcil_build_policydbhas undefined version LIBSEPOL_1.1
clang: error: linker command failed with exit code 1 (use -v to see invocation)The simplest fix appears to be to just drop the symver entries when building on Android.
Signed-off-by Stephen Smalley <[email protected]>--- libsepol/Android.mk | 1 + libsepol/cil/src/cil.c | 2 ++ 2 files changed, 3 insertions(+)libsepol/Android.mk +0
-0
libsepol/Android.mk cil_src_files := \ · line 65
Quoted 4 lines
libsepol/Android.mk +1
-0@@ -62,6 +62,7 @@ cil_src_files := \ cil/src/cil_verify.c common_cflags := \ + -D_ANDROID_ \
Android builds set the flag ANDROID by default, not _ANDROID_ . If use use ANDROID instead of _ANDROID_ you don't need the Android.mk change.
Quoted 31 lines
libsepol/Android.mk +0
-0-Wall -W -Wundef \ -Wshadow -Wmissing-noreturn \ -Wmissing-format-attributelibsepol/cil/src/cil.c +2
-1@@ -51,6 +51,7 @@#include "cil_policy.h" #include "cil_strpool.h" +#ifndef _ANDROID_ asm(".symver cil_build_policydb_pdb, cil_build_policydb@" ); asm(".symver cil_build_policydb_create_pdb, cil_build_policydb@@LIBSEPOL_1.1" );@@ -65,6 +66,7 @@ asm(".symver cil_selinuxusers_to_string_nopdb, cil_selinuxusers_to_string@@LIBSE asm(".symver cil_filecons_to_string_pdb, cil_filecons_to_string@" ); asm(".symver cil_filecons_to_string_nopdb, cil_filecons_to_string@@LIBSEPOL_1.1" ); +#endif int cil_sym_sizes[CIL_SYM_ARRAY_NUM ][CIL_SYM_NUM ] = { {64 ,64 ,64 ,1 <<13 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 ,64 }, --1.9.3
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].
Signature · 1 line
Nick Kralevich | Android Security | [email protected] | 650.214.4037