Date: Mon, 15 Apr 2013 18:09:22 +0800 From: Alie Tan <alie@affle.com> To: Oleksandr Tymoshenko <gonzo@bluezbox.com> Cc: Tim Kientzle <tim@kientzle.com>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: Unable to compile VCHIQ Message-ID: <CANuCnH_9gz%2BDi%2Bm_F-csNS-9ByuDVBDV%2BkhvgD4tNatE0U31xQ@mail.gmail.com> In-Reply-To: <51687F65.4020703@bluezbox.com> References: <CANuCnH9p%2BaY89wy%2BT6BDdo--URGXP5BZK8KBp6-UQRfdHLgUyg@mail.gmail.com> <51438529.4080604@bluezbox.com> <4FD89AF1-AF9D-4950-8AA4-9CC95FE66D46@kientzle.com> <456661659-1363845801-cardhu_decombobulator_blackberry.rim.net-733146442-@b26.c6.bise3.blackberry> <C2DF8350-459B-4B30-9F41-2DE1EF855170@kientzle.com> <CANuCnH9fe5aZJ2fHXA3qMKDd9b=dMngMHexjhfWDbxxhmzaAyQ@mail.gmail.com> <51687F65.4020703@bluezbox.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 13, 2013 at 5:40 AM, Oleksandr Tymoshenko <gonzo@bluezbox.com>wrote: > On 4/12/2013 12:09 AM, Alie Tan wrote: > >> On Mon, Mar 25, 2013 at 6:19 AM, Tim Kientzle <tim@kientzle.com <mailto: >> tim@kientzle.com>> wrote: >> >> > From: Tim Kientzle <tim@kientzle.com <mailto:tim@kientzle.com>> >> > Sender: owner-freebsd-arm@freebsd.**orgDate: Wed, 20 Mar 2013 >> 23:01:26 >> > To: Oleksandr Tymoshenko<gonzo@bluezbox.com >> <mailto:gonzo@bluezbox.com>> >> > Cc: <freebsd-arm@freebsd.org <mailto:freebsd-arm@freebsd.**org<freebsd-arm@freebsd.org> >> >> >> > Subject: Re: Unable to compile VCHIQ >> > >> > >> > On Mar 15, 2013, at 1:31 PM, Oleksandr Tymoshenko wrote: >> > >> >>> cc -O3 -pipe -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM >> >>> -D__VCCOREVER__=0x04000000 -O3 -fno-strict-aliasing >> -funroll-loops -pipe >> >>> -ftree-vectorize -D_KERNEL -DKLD_MODULE -nostdinc >> >>> -I/usr/src/vc/vchiq-freebsd/**interface -I. -I@ -I@/contrib/altq >> >>> -finline-limit=8000 --param inline-unit-growth=100 --param >> >>> large-function-growth=1000 -fno-common -ffreestanding >> -std=iso9899:1999 >> >>> -c /usr/src/vc/vchiq-freebsd/**interface/vchiq_arm/vchiq_** >> 2835_arm.c >> >>> In file included from >> >>> /usr/src/vc/vchiq-freebsd/**interface/vchiq_arm/vchiq_** >> 2835_arm.c:65: >> >>> @/vm/vm_pager.h: In function 'vm_pager_get_pages': >> >>> @/vm/vm_pager.h:127: warning: implicit declaration of function >> 'rw_assert' >> >>> @/vm/vm_pager.h:127: error: 'RA_WLOCKED' undeclared (first use >> in this >> >>> function) >> >>> @/vm/vm_pager.h:127: error: (Each undeclared identifier is >> reported only >> >>> once >> >>> @/vm/vm_pager.h:127: error: for each function it appears in.) >> >>> @/vm/vm_pager.h: In function 'vm_pager_put_pages': >> >>> @/vm/vm_pager.h:144: error: 'RA_WLOCKED' undeclared (first use >> in this >> >>> function) >> >>> @/vm/vm_pager.h: In function 'vm_pager_has_page': >> >>> @/vm/vm_pager.h:168: error: 'RA_WLOCKED' undeclared (first use >> in this >> >>> function) >> >>> @/vm/vm_pager.h: In function 'vm_pager_page_unswapped': >> >>> @/vm/vm_pager.h:191: error: 'RA_WLOCKED' undeclared (first use >> in this >> >>> function) >> >>> *** [vchiq_2835_arm.o] Error code 1 >> >>> >> >>> Stop in /usr/src/vc/vchiq-freebsd. >> >>> >> >>> >> >>> Anyone got idea how to solve the issue? >> >>> >> >> >> >> It seems you're trying to build vchiq against your host sources >> which is wrong. You need >> >> to use cross-compilation environment for this. >> > >> > I'm seeing this now, too, and I've checked carefully: I'm >> > definitely building inside the "buildworld" cross environment. >> > >> > It looks like RA_WLOCKED is only defined if INVARIANTS is >> > active (sys/sys/rwlock.h). >> >> The attached patch to vchiq fixes it for me. >> >> Cheers, >> >> Tim >> >> >> i am getting different error now: >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.c:34: >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.h:44: >> ./interface/compat/vchi_bsd.h:**97:33: error: passing 'atomic_t *' (aka >> 'volatile int *') to parameter of type 'volatile uint32_t *' >> (aka 'volatile unsigned int *') converts between pointers to >> integer types with different sign [-Werror,-Wpointer-sign] >> return i + atomic_fetchadd_int(v, i); >> ^ >> ./machine/atomic.h:333:39: note: passing argument to parameter 'p' here >> atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) >> ^ >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.c:34: >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.h:44: >> ./interface/compat/vchi_bsd.h:**103:29: error: passing 'atomic_t *' (aka >> 'volatile int *') to parameter of type 'volatile uint32_t *' >> (aka 'volatile unsigned int *') converts between pointers to >> integer types with different sign [-Werror,-Wpointer-sign] >> return atomic_fetchadd_int(v, -i) - i; >> ^ >> ./machine/atomic.h:333:39: note: passing argument to parameter 'p' here >> atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) >> ^ >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.c:34: >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.h:44: >> ./interface/compat/vchi_bsd.h:**109:28: error: passing 'atomic_t *' (aka >> 'volatile int *') to parameter of type 'volatile u_int32_t *' >> (aka 'volatile unsigned int *') converts between pointers to >> integer types with different sign [-Werror,-Wpointer-sign] >> if (atomic_cmpset_rel_int(v, oldv, newv)) >> ^ >> ./machine/atomic.h:248:42: note: passing argument to parameter 'p' here >> atomic_cmpset_rel_32(volatile u_int32_t *p, volatile u_int32_t cmpval, >> volatile u_int32_t newval) >> ^ >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.c:34: >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.h:44: >> ./interface/compat/vchi_bsd.h:**120:34: error: passing 'atomic_t *' (aka >> 'volatile int *') to parameter of type 'volatile u_int32_t *' >> (aka 'volatile unsigned int *') converts between pointers to >> integer types with different sign [-Werror,-Wpointer-sign] >> return atomic_readandclear_int(v); >> ^ >> ./machine/atomic.h:348:44: note: passing argument to parameter 'p' here >> atomic_readandclear_32(**volatile u_int32_t *p) >> ^ >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.c:34: >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.h:44: >> ./interface/compat/vchi_bsd.h:**123:31: error: passing 'atomic_t *' (aka >> 'volatile int *') to parameter of type 'volatile uint32_t *' >> (aka 'volatile unsigned int *') converts between pointers to >> integer types with different sign [-Werror,-Wpointer-sign] >> oldv = atomic_load_acq_int(v); >> ^ >> ./machine/atomic.h:363:39: note: passing argument to parameter 'p' here >> atomic_load_acq_32(volatile uint32_t *p) >> ^ >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.c:34: >> In file included from /usr/src/vc/vchiq-freebsd/** >> interface/vchiq_arm/vchiq_**core.h:44: >> ./interface/compat/vchi_bsd.h:**124:35: error: passing 'atomic_t *' (aka >> 'volatile int *') to parameter of type 'volatile u_int32_t *' >> (aka 'volatile unsigned int *') converts between pointers to >> integer types with different sign [-Werror,-Wpointer-sign] >> } while (!atomic_cmpset_rel_int(v, oldv, newv)); >> ^ >> ./machine/atomic.h:248:42: note: passing argument to parameter 'p' here >> atomic_cmpset_rel_32(volatile u_int32_t *p, volatile u_int32_t cmpval, >> volatile u_int32_t newval) >> ^ >> 6 errors generated. >> *** [vchiq_core.o] Error code 1 >> >> Stop in /usr/src/vc/vchiq-freebsd. >> > > Tim also submitted additional patches via pull requests. Took me some time > to get around to merge them but now vchiq-freebsd code should be compilable > with clang > Thanks, but now I am getting another error CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE): The C compiler "/usr/bin/gcc" is not able to compile a simple test program. It fails with the following output: Change Dir: /usr/src/vc/userland/build/arm-freebsd/release/CMakeFiles/CMakeTmp Run Build Command:/usr/bin/make "cmTryCompileExec2325164285/fast" /usr/bin/make -f CMakeFiles/cmTryCompileExec2325164285.dir/build.make CMakeFiles/cmTryCompileExec2325164285.dir/build /usr/local/bin/cmake -E cmake_progress_report /usr/src/vc/userland/build/arm-freebsd/release/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec2325164285.dir/testCCompiler.c.o /usr/bin/gcc -mcpu=arm1176jzf-s -mfpu=vfp -o CMakeFiles/cmTryCompileExec2325164285.dir/testCCompiler.c.o -c /usr/src/vc/userland/build/arm-freebsd/release/CMakeFiles/CMakeTmp/testCCompiler.c `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. cc1: error: unrecognized command line option "-mfpu=vfp" /usr/src/vc/userland/build/arm-freebsd/release/CMakeFiles/CMakeTmp/testCCompiler.c:1: error: bad value (arm1176jzf-s) for -mtune= switch *** [CMakeFiles/cmTryCompileExec2325164285.dir/testCCompiler.c.o] Error code 1 Stop in /usr/src/vc/userland/build/arm-freebsd/release/CMakeFiles/CMakeTmp. *** [cmTryCompileExec2325164285/fast] Error code 1 Stop in /usr/src/vc/userland/build/arm-freebsd/release/CMakeFiles/CMakeTmp. CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:3 (project) -- Configuring incomplete, errors occurred!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANuCnH_9gz%2BDi%2Bm_F-csNS-9ByuDVBDV%2BkhvgD4tNatE0U31xQ>