On Mon, Jan 28, 2013 at 11:26 AM, Charlie Fenton <[email protected]>wrote:
> On Jan 27, 2013, at 9:19 PM, Rom Walton wrote: > > Should be fixed. > > Thanks. But I am curious why the CFLAGS are different from the CXXFLAGS > in all 5 Android build scripts: boinc/android/build_curl.ssh, > boinc/android/build_openssl.sh, boinc/android/build_boinc.sh, > boinc/samples/wrapper/build_android.sh and > boinc/samples/example_app/build_android.sh. > > * 3 of the scripts (build_boinc.sh and the 2 samples) have > "-DDECLARE_TIMEZONE", but only in CFLAGS and not in CXXFLAGS. I have not > found any reference to DECLARE_TIMEZONE in any of our source files. Why is > this needed, and why only in CFLAGS? > I don't remember the details, but somehow DECLARE_TIMEZONE was required to build boinc_zip. > * All 5 scripts have "-funroll-loops -fexceptions" in CXXFLAGS but not > CFLAGS. > In particular, the -fexceptions inconsistency seems backwards based on my > reading of the compiler documentation, which says: > > If you do not specify this option, GCC will enable it by default for > languages like C++ which normally require exception handling, and disable > it for languages like C that do not normally require it. However, you may > need to enable this option when compiling C code that needs to interoperate > properly with exception handlers written in C++. You may also wish to > disable this option if you are compiling older C++ programs that don't use > exception handling. > > So it seems that, if it is needed at all, it should be specified for > CFLAGS and is unnecessary for CXXFLAGS. > > Cheers, > --Charlie > > -- > Charlie Fenton [email protected] > BOINC / SETI@home Macintosh & Windows Programmer > Space Sciences Laboratory > UC Berkeley > > > > On Jan 27, 2013, at 9:19 PM, Rom Walton wrote: > > > Should be fixed. > > > > ----- Rom > > > > -----Original Message----- > > From: Charlie Fenton [mailto:[email protected]] > > Sent: Saturday, January 26, 2013 6:42 AM > > To: Rom Walton > > Cc: David Anderson (BOINC) > > Subject: Re: Errors building wrapper for Android > > > > Hi Rom, > > > >> It looks like it was using the Linux c++ compiler instead of the the > > android compiler. > > > > Good catch. But actually, it was not using any c++ compiler, but rather > > it was using the Linux C compiler (gcc) instead of the android C > > compiler (arm-linux-androideabi-gcc). These are *.c files, not *.cpp > > files and so it should compile with gcc rather than g++. > > > >> In the make file change the references to the cc compiler to $(CXX). > > > > I think a better solution is to add the following lines to > > wrapper/build_android.sh (so we continue to use gcc rather than g++ for > > *.c files): > > > > export CC=arm-linux-androideabi-gcc > > export CFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -funroll-loops > > -fexceptions -O3 -fomit-frame-pointer -I$TCINCLUDES/include -I$BOINC_DIR > > -I$BOINC_LIB_DIR -I$BOINC_API_DIR -I$BOINC_ZIP_DIR" > > > > I recommend always exporting CC as well as CXX and CFLAGS as well as > > CXXFLAGS. This is already being done in boinc/android/build_curl.ssh, > > boinc/android/build_openssl.sh and boinc/android/build_boinc.sh, but > > not in boinc/samples/wrapper/build_android.sh or > > boinc/samples/example_app/build_android.sh. > > > > Cheers, > > --Charlie > > > > -- > > Charlie Fenton [email protected] > > BOINC / SETI@home Macintosh & Windows Programmer Space Sciences > > Laboratory UC Berkeley > > > > > > > > On Jan 25, 2013, at 6:52 PM, Rom Walton wrote: > > > >> Hmmmmm > >> > >> In the make file change the references to the cc compiler to $(CXX). > >> > >> It looks like it was using the Linux c++ compiler instead of the the > > android compiler. > >> > >> ----- Rom > >> > >> Charlie Fenton <[email protected]> wrote: > >> > >> I was mistaken about the missing.o files. I got the updated > > wrapper.cpp from GIT, deleted the .o files and tried again, but still > > get the same errors: > >> > >>> boincadm@boinc-build-android:~$ cd > >>> '/home/boincadm/boinc/samples/wrapper' > >>> boincadm@boinc-build-android:~/boinc/samples/wrapper$ > >>> ./build_android.sh > >>> arm-linux-androideabi-g++ --sysroot=/home/boincadm/android-tc/sysroot > > -DANDROID -Wall -funroll-loops -fexceptions -O3 -fomit-frame-pointer > > -I/home/boincadm/android-tc/arm-linux-androideabi/include -I../.. > > -I../../lib -I../../api -I../../zip -c -o wrapper.o wrapper.cpp > >>> cc -c -o regexp.o regexp.c > >>> cc -c -o regsub.o regsub.c > >>> cc -c -o regerror.o regerror.c > >>> cc -c -o regexp_memory.o regexp_memory.c > >>> cc -c -o regexp_report.o regexp_report.c > >>> arm-linux-androideabi-g++ --sysroot=/home/boincadm/android-tc/sysroot > > > >>> arm-linux-androideabi-g++ -DANDROID -Wall -funroll-loops > >>> arm-linux-androideabi-g++ -fexceptions -O3 -fomit-frame-pointer > >>> arm-linux-androideabi-g++ -I/home/boincadm/android-tc/arm-linux-andro > >>> arm-linux-androideabi-g++ ideabi/include -I../.. -I../../lib > >>> arm-linux-androideabi-g++ -I../../api -I../../zip > >>> arm-linux-androideabi-g++ -L/home/boincadm/android-tc/sysroot/usr/lib > > > >>> arm-linux-androideabi-g++ -L/home/boincadm/android-tc/arm-linux-andro > >>> arm-linux-androideabi-g++ ideabi/lib -L../.. -L../../lib -L../../api > >>> arm-linux-androideabi-g++ -L../../zip -llog -o wrapper wrapper.o > >>> arm-linux-androideabi-g++ regexp.o regsub.o regerror.o > >>> arm-linux-androideabi-g++ regexp_memory.o regexp_report.o -lboinc_api > > > >>> arm-linux-androideabi-g++ -lboinc -lboinc_zip > >>> arm-linux-androideabi-g++ /home/boincadm/android-tc/arm-linux-android > >>> arm-linux-androideabi-g++ eabi/lib/libstdc++.a > >>> /home/boincadm/android-tc/bin/../lib/gcc/arm-linux-androideabi/4.4.3/ > >>> ../../../../arm-linux-androideabi/bin/ld: regexp.o: Relocations in > >>> generic ELF (EM: 3) > >>> /home/boincadm/android-tc/bin/../lib/gcc/arm-linux-androideabi/4.4.3/ > >>> ../../../../arm-linux-androideabi/bin/ld: regexp.o: Relocations in > >>> generic ELF (EM: 3) > >>> /home/boincadm/android-tc/bin/../lib/gcc/arm-linux-androideabi/4.4.3/ > >>> ../../../../arm-linux-androideabi/bin/ld: regexp.o: Relocations in > >>> generic ELF (EM: 3) > >>> regexp.o: could not read symbols: File in wrong format > >>> collect2: ld returned 1 exit status > >>> make: *** [wrapper] Error 1 > >>> boincadm@boinc-build-android:~/boinc/samples/wrapper$ > >> > >> Cheers, > >> --Charlie > >> > >> -- > >> Charlie Fenton [email protected] > >> BOINC / SETI@home Macintosh & Windows Programmer Space Sciences > >> Laboratory UC Berkeley > >> > >> > >> > >> On Jan 25, 2013, at 5:32 PM, Charlie Fenton wrote: > >> > >>> Hi Rom, > >>> > >>> Running under your Ubuntu VM, I don't see any .o files in the > > directory after running the build_android.sh script: > >>> > >>>> boincadm@boinc-build-android:~$ cd > > '/home/boincadm/boinc/samples/wrapper' > >>>> boincadm@boinc-build-android:~/boinc/samples/wrapper$ > >>>> ./build_android.sh > >>>> arm-linux-androideabi-g++ --sysroot=/home/boincadm/android-tc/sysroo > >>>> arm-linux-androideabi-g++ t -DANDROID -Wall -funroll-loops > >>>> arm-linux-androideabi-g++ -fexceptions -O3 -fomit-frame-pointer > >>>> arm-linux-androideabi-g++ -I/home/boincadm/android-tc/arm-linux-andr > >>>> arm-linux-androideabi-g++ oideabi/include -I../.. -I../../lib > >>>> arm-linux-androideabi-g++ -I../../api -I../../zip > >>>> arm-linux-androideabi-g++ -L/home/boincadm/android-tc/sysroot/usr/li > >>>> arm-linux-androideabi-g++ b > >>>> arm-linux-androideabi-g++ -L/home/boincadm/android-tc/arm-linux-andr > >>>> arm-linux-androideabi-g++ oideabi/lib -L../.. -L../../lib > >>>> arm-linux-androideabi-g++ -L../../api -L../../zip -llog -o wrapper > >>>> arm-linux-androideabi-g++ wrapper.o regexp.o regsub.o regerror.o > >>>> arm-linux-androideabi-g++ regexp_memory.o regexp_report.o > >>>> arm-linux-androideabi-g++ -lboinc_api -lboinc -lboinc_zip > >>>> arm-linux-androideabi-g++ /home/boincadm/android-tc/arm-linux-androi > >>>> arm-linux-androideabi-g++ deabi/lib/libstdc++.a > >>>> /home/boincadm/android-tc/bin/../lib/gcc/arm-linux-androideabi/4.4.3 > >>>> /../../../../arm-linux-androideabi/bin/ld: regexp.o: Relocations in > >>>> generic ELF (EM: 3) > >>>> /home/boincadm/android-tc/bin/../lib/gcc/arm-linux-androideabi/4.4.3 > >>>> /../../../../arm-linux-androideabi/bin/ld: regexp.o: Relocations in > >>>> generic ELF (EM: 3) > >>>> /home/boincadm/android-tc/bin/../lib/gcc/arm-linux-androideabi/4.4.3 > >>>> /../../../../arm-linux-androideabi/bin/ld: regexp.o: Relocations in > >>>> generic ELF (EM: 3) > >>>> regexp.o: could not read symbols: File in wrong format > >>>> collect2: ld returned 1 exit status > >>>> make: *** [wrapper] Error 1 > >>>> boincadm@boinc-build-android:~/boinc/samples/wrapper$ > >>> > >>> When I run the build_android.sh script in example_app, I do see the > > uc2.o file and it builds the executable without errors: > >>> > >>>> boincadm@boinc-build-android:~/boinc/samples/wrapper$ cd > > '/home/boincadm/boinc/samples/example_app' > >>>> boincadm@boinc-build-android:~/boinc/samples/example_app$ > > ./build_android.sharm-linux-androideabi-g++ > > --sysroot=/home/boincadm/android-tc/sysroot -DANDROID -Wall > > -funroll-loops -fexceptions -O3 -fomit-frame-pointer > > -I/home/boincadm/android-tc/arm-linux-androideabi/include -I../.. > > -I../../lib -I../../api -I../../zip -c -o uc2.o uc2.cpp > >>>> arm-linux-androideabi-g++ --sysroot=/home/boincadm/android-tc/sysroo > >>>> arm-linux-androideabi-g++ t -DANDROID -Wall -funroll-loops > >>>> arm-linux-androideabi-g++ -fexceptions -O3 -fomit-frame-pointer > >>>> arm-linux-androideabi-g++ -I/home/boincadm/android-tc/arm-linux-andr > >>>> arm-linux-androideabi-g++ oideabi/include -I../.. -I../../lib > >>>> arm-linux-androideabi-g++ -I../../api -I../../zip > >>>> arm-linux-androideabi-g++ -L/home/boincadm/android-tc/sysroot/usr/li > >>>> arm-linux-androideabi-g++ b > >>>> arm-linux-androideabi-g++ -L/home/boincadm/android-tc/arm-linux-andr > >>>> arm-linux-androideabi-g++ oideabi/lib -L../.. -L../../lib > >>>> arm-linux-androideabi-g++ -L../../api -L../../zip -llog -o uc2 uc2.o > > > >>>> arm-linux-androideabi-g++ ../../api/libboinc_api.a > >>>> arm-linux-androideabi-g++ ../../lib/libboinc.a > >>>> arm-linux-androideabi-g++ /home/boincadm/android-tc/arm-linux-androi > >>>> arm-linux-androideabi-g++ deabi/lib/libstdc++.a > >>>> boincadm@boinc-build-android:~/boinc/samples/example_app$ > >>> > >>> Cheers, > >>> --Charlie > >> > >> > > > > > > _______________________________________________ > boinc_dev mailing list > [email protected] > http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev > To unsubscribe, visit the above URL and > (near bottom of page) enter your email address. > _______________________________________________ boinc_dev mailing list [email protected] http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev To unsubscribe, visit the above URL and (near bottom of page) enter your email address.
