diff options
author | Alex Vakulenko <avakulenko@google.com> | 2016-07-27 09:54:12 -0700 |
---|---|---|
committer | Alex Vakulenko <avakulenko@google.com> | 2016-07-27 09:54:12 -0700 |
commit | 217f61b2e8d2beed2fe7fa1124e1d4f52a042ab8 (patch) | |
tree | e69a219fc144ff37a586304b22bd45f2783a5efa /libwifi_hal | |
parent | 038e768eaa10301cf6299587e089fc75ab90cfe9 (diff) | |
download | android_frameworks_opt_net_wifi-217f61b2e8d2beed2fe7fa1124e1d4f52a042ab8.tar.gz android_frameworks_opt_net_wifi-217f61b2e8d2beed2fe7fa1124e1d4f52a042ab8.tar.bz2 android_frameworks_opt_net_wifi-217f61b2e8d2beed2fe7fa1124e1d4f52a042ab8.zip |
Fix wifi_hal_common for the case where kernel modules are used
When WIFI_DRIVER_MODULE_PATH is defined, wifi_hal_common.cpp fails
to compile with the following errors:
wifi_hal_common.cpp:68: error: undefined reference to 'init_module(void*, unsigned long, char const*)'
wifi_hal_common.cpp:81: error: undefined reference to 'delete_module(char const*, unsigned int)'
The problem is that this is a C++ source and the extern functions
are have C++ name mangling applied to it:
$ nm $OUT/obj/STATIC_LIBRARIES/libwifi-hal-common_intermediates/libwifi-hal-common.a | grep _module
U _Z11init_modulePvmPKc
U _Z13delete_modulePKcj
These functions must be declared as extern "C" in order to link
successfully with libc.so.
BUG=None
TEST=m -j32
Change-Id: Ic8f15790b5d92ca40eb14a64ace36fd177cc4ea3
Diffstat (limited to 'libwifi_hal')
-rw-r--r-- | libwifi_hal/wifi_hal_common.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libwifi_hal/wifi_hal_common.cpp b/libwifi_hal/wifi_hal_common.cpp index 54c38e135..86d5db7e5 100644 --- a/libwifi_hal/wifi_hal_common.cpp +++ b/libwifi_hal/wifi_hal_common.cpp @@ -26,8 +26,8 @@ #include <cutils/misc.h> #include <cutils/properties.h> -extern int init_module(void *, unsigned long, const char *); -extern int delete_module(const char *, unsigned int); +extern "C" int init_module(void *, unsigned long, const char *); +extern "C" int delete_module(const char *, unsigned int); #ifndef WIFI_DRIVER_FW_PATH_STA #define WIFI_DRIVER_FW_PATH_STA NULL |