Google Groups

Re: sqlite3 error


Pekka Nikander Jan 30, 2013 1:42 AM
Posted in group: Android Building
On Mac OS X 10.7 or newer, with Xcode 4.5 or newer, you need this patch instead:

diff --git a/dist/Android.mk b/dist/Android.mk
index 3fdaefc..3f217c5 100644
--- a/dist/Android.mk
+++ b/dist/Android.mk
@@ -133,6 +133,9 @@ ifneq ($(HOST_OS),freebsd)
 LOCAL_LDLIBS += -ldl
 endif
 endif
+ifeq ($(HOST_OS),darwin)
+LOCAL_LDFLAGS += -Wl,-U,_sqlite3_androidopt_open -Wl,-U,_sqlite3_androidopt_handle_pragma
+endif
 
 LOCAL_MODULE := sqlite3
 
A good explanation of what's going on can be found here:


--Pekka

On Wednesday, 19 October 2011 08:13:24 UTC+3, Nick wrote:
I changed __attribute__((weak)) to

 __attribute__((weak_import))
for each of the offending variables in sqlite3.c , and this seemed to
do the trick.

On Oct 17, 11:18 am, Dominic Binks <dbi...@codeaurora.org> wrote:
> On 10/15/2011 7:49 PM, Nick wrote:
>
>
>
> > I've googled this error to death, yet I still have no idea what the
> > root of the problem is.  I downloaded the source from codeaurora a few
> > days ago, and I'm running on OSX 10.6.8.  Below is the terminal log.
> > Any ideas?
>
> > ============================================
> > PLATFORM_VERSION_CODENAME=REL
> > PLATFORM_VERSION=2.3.5
> > TARGET_PRODUCT=generic
> > TARGET_BUILD_VARIANT=eng
> > TARGET_SIMULATOR=
> > TARGET_BUILD_TYPE=release
> > TARGET_BUILD_APPS=
> > TARGET_ARCH=arm
> > HOST_ARCH=x86
> > HOST_OS=darwin
> > HOST_BUILD_TYPE=release
> > BUILD_ID=GRJ90
> > ============================================
> > build/core/base_rules.mk:105: *** Module name: hostapd contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: hostapd_cli contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: nt_password_hash
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: hlr_auc_gw contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: Stk contains invalid
> > LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:146: user tag on app Stk at packages/apps/Stk
> > - add your app to core.mk instead
> > build/core/base_rules.mk:105: *** Module name: ip contains invalid
> > LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libqsap_sdk contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: pvplayer contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_common
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_author
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_player
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libomx_sharedlibrary
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name:
> > libomx_avcdec_sharedlibrary contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name:
> > libomx_m4vdec_sharedlibrary contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name:
> > libomx_aacdec_sharedlibrary contains invalid LOCAL_MODULE_TAGS
> > build/core/copy_headers.mk:15: warning: overriding commands for target
> > `out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
> > build/core/copy_headers.mk:15: warning: ignoring old commands for
> > target `out/target/product/generic/obj/include/libpv/
> > getactualaacconfig.h'
> > build/core/base_rules.mk:105: *** Module name:
> > libomx_amrdec_sharedlibrary contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name:
> > libomx_mp3dec_sharedlibrary contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name:
> > libomx_amrenc_sharedlibrary contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_net_support
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_downloadreg
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_download
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_rtspreg
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_rtsp
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_mp4localreg
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libopencore_mp4local
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libQWiFiSoftApCfg
> > contains invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libOmxCore contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: libmm-omxcore contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: librefcne contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: cnd contains invalid
> > LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:105: *** Module name: QualcommSoftAP contains
> > invalid LOCAL_MODULE_TAGS
> > build/core/base_rules.mk:146: user tag on app QualcommSoftAP at
> > packages/apps/QualcommSoftAP - add your app to core.mk instead
> > host Executable: sqlite3 (out/host/darwin-x86/obj/EXECUTABLES/
> > sqlite3_intermediates/sqlite3)
> > Undefined symbols:
> >    "_sqlite3_androidopt_handle_pragma", referenced from:
> >        _sqlite3Pragma in sqlite3.o
> >        _sqlite3_androidopt_handle_pragma$non_lazy_ptr in sqlite3.o
> >       (maybe you meant: _sqlite3_androidopt_handle_pragma$non_lazy_ptr)
> >    "_sqlite3_androidopt_open", referenced from:
> >        _openDatabase in sqlite3.o
> >        _sqlite3_androidopt_open$non_lazy_ptr in sqlite3.o
> >       (maybe you meant: _sqlite3_androidopt_open$non_lazy_ptr)
> > ld: symbol(s) not found
> > collect2: ld returned 1 exit status
> > make: *** [out/host/darwin-x86/obj/EXECUTABLES/sqlite3_intermediates/
> > sqlite3] Error 1
>
> I imagine it's building on Mac - we don't test the code to verify mac
> builds at all so I'd be pleasantly surprised if it did build.
>
> --
> Dominic Binks: dbi...@codeaurora.org
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum