Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error LONG_BIT definition appears wrong for platform #206

Closed
brussee opened this issue Mar 3, 2016 · 2 comments
Closed

error LONG_BIT definition appears wrong for platform #206

brussee opened this issue Mar 3, 2016 · 2 comments

Comments

@brussee
Copy link

brussee commented Mar 3, 2016

I run into the following error if I try to cross-compile for android. What config option should I change?

arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/paul/android-ndk-r10e/platforms/android-16/arch-arm -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/paul/android-ndk-r10e/platforms/android-16/arch-arm -fPIC -DEXPERIMENTAL=1 -DNDEBUG=1 -DAPSW_FORK_CHECKER=1 -DAPSW_USE_SQLITE_AMALGAMATION="/home/paul/.local/share/python-for-android/build/other_builds/apsw/armeabi/apsw/sqlite3/sqlite3.c" -DAPSW_USE_SQLITE_CONFIG="/home/paul/.local/share/python-for-android/build/other_builds/apsw/armeabi/apsw/sqlite3/sqlite3config.h" -Isrc -I/home/paul/.local/share/python-for-android/build/other_builds/apsw/armeabi/apsw/sqlite3 -I/home/paul/.local/share/python-for-android/build/other_builds/hostpython2/desktop/hostpython2/Include -I/home/paul/.local/share/python-for-android/build/other_builds/hostpython2/desktop/hostpython2 -c src/apsw.c -o build/temp.linux-x86_64-2.7/src/apsw.o

In file included from /home/paul/.local/share/python-for-android/build/other_builds/hostpython2/desktop/hostpython2/Include/Python.h:58:0,
                 from src/apsw.c:74:
/home/paul/.local/share/python-for-android/build/other_builds/hostpython2/desktop/hostpython2/Include/pyport.h:849:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^
@brussee
Copy link
Author

brussee commented Mar 3, 2016

For future reference: I fixed this by setting the following flags:

        env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
        env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7' + \
                         ' -I' + self.get_recipe('sqlite3', self.ctx).get_build_dir(arch.arch)
        # Set linker to use the correct gcc
        env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
        env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
                          ' -lpython2.7' + \
                          ' -lsqlite3'

@brussee brussee closed this as completed Mar 3, 2016
@rogerbinns
Copy link
Owner

None of this has anything to do with APSW, It doesn't use LONG_BIT nor is the header with the problem part of APSW,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants