[strongSwan] Android Compilation issues with 5.2.0-rc1
Andre Valentin
avalentin at marcant.net
Mon Jun 30 22:11:00 CEST 2014
Hi!
Because of the annoying bugs in Android 4.4 VPN stack I decided to run strongswan natively under Android.
With libipsec it should run without kernel rebuilds, just root should be needed :-)
So I checked it to my external directory out. I did not add the strongswan-support dir
and its contents!
But some errors with duplicate definetions appeared, so I removed them in
diff --git a/src/include/linux/types.h b/src/include/linux/types.h
index 22cfdc0..02e5719 100644
--- a/src/include/linux/types.h
+++ b/src/include/linux/types.h
@@ -9,22 +9,22 @@
typedef __u32 __kernel_dev_t;
-typedef __kernel_fd_set fd_set;
+//typedef __kernel_fd_set fd_set;
typedef __kernel_dev_t dev_t;
typedef __kernel_ino_t ino_t;
typedef __kernel_mode_t mode_t;
-typedef __kernel_nlink_t nlink_t;
+//typedef __kernel_nlink_t nlink_t;
typedef __kernel_off_t off_t;
typedef __kernel_pid_t pid_t;
typedef __kernel_daddr_t daddr_t;
typedef __kernel_key_t key_t;
typedef __kernel_suseconds_t suseconds_t;
-typedef __kernel_timer_t timer_t;
+//typedef __kernel_timer_t timer_t;
typedef __kernel_clockid_t clockid_t;
typedef __kernel_mqd_t mqd_t;
-typedef __kernel_uid_t uid_t;
-typedef __kernel_gid_t gid_t;
+//typedef __kernel_uid_t uid_t;
+//typedef __kernel_gid_t gid_t;
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __kernel_loff_t loff_t;
They are now defined in bionic .. I think some ifdefs help, but at first let's get on!
Compilation now started but broke here (lots of files worked fine):
$ mm
============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=4.4.3.43.43.43
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.15.0-x86_64-with-debian-7.5
HOST_BUILD_TYPE=release
BUILD_ID=AOSP
OUT_DIR=out
============================================
make: Entering directory `/usr/src/android/4.1.1-upload'
make: *** No rule to make target `external/strongswan/src/libstrongswan/settings/settings_parser.c', needed by
`out/target/product/generic/obj/SHARED_LIBRARIES/libstrongswan_intermediates/settings/settings_parser.o'. Stop.
make: Leaving directory `/usr/src/android/4.1.1-upload'
I took a look and saw that the changes in the configuration API broke this. This was my solution:
diff --git a/src/libstrongswan/Android.mk b/src/libstrongswan/Android.mk
index 3ddd42f..f887ef5 100644
--- a/src/libstrongswan/Android.mk
+++ b/src/libstrongswan/Android.mk
@@ -33,8 +33,8 @@ networking/streams/stream_tcp.c networking/streams/stream_service_tcp.c \
pen/pen.c plugins/plugin_loader.c plugins/plugin_feature.c processing/jobs/job.c \
processing/jobs/callback_job.c processing/processor.c processing/scheduler.c \
processing/watcher.c resolver/resolver_manager.c resolver/rr_set.c \
-selectors/traffic_selector.c settings/settings.c settings/settings_types.c \
-settings/settings_parser.c settings/settings_lexer.c \
+selectors/traffic_selector.c \
+settings/settings_lexer.l settings/settings_parser.y settings/settings.c settings/settings_types.c \
utils/utils.c utils/chunk.c utils/debug.c utils/enum.c utils/identification.c \
utils/lexparser.c utils/optionsfrom.c utils/capabilities.c utils/backtrace.c \
utils/parser_helper.c utils/test.c utils/utils/strerror.c
and got this:
# mm
external/strongswan/src/libstrongswan/plugins/xcbc/xcbc_plugin.c: In function 'get_features':
external/strongswan/src/libstrongswan/plugins/xcbc/xcbc_plugin.c:40:277: warning: unused parameter 'this' [-Wunused-parameter]
METHOD(plugin_t, get_features, int,
^
Lex: libstrongswan <= external/strongswan/src/libstrongswan/settings/settings_lexer.l
target arm C++: libstrongswan <= out/target/product/generic/obj/SHARED_LIBRARIES/libstrongswan_intermediates/settings/settings_lexer.cpp
arm-linux-androideabi-g++: error: out/target/product/generic/obj/SHARED_LIBRARIES/libstrongswan_intermediates/settings/settings_lexer.cpp: No such file or directory
arm-linux-androideabi-g++: fatal error: no input files
compilation terminated.
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libstrongswan_intermediates/settings/settings_lexer.o] Error 1
That's where I couldn't find a solution. Do you have an idea how to fix this or move it to the new config API?
Kind regards,
André
More information about the Users
mailing list