Raspberry Pi OPNsense

Started by jorgevisentini, October 05, 2017, 05:57:27 PM

Previous topic - Next topic
Have anyone tested this on Banana Pi 1? I have both RPi2 and BPi1 but I think BPi1 is better in performance. Apart from that it comes with a Gigabit LAN.

Thank you,
Regards,
Bobby Thomas

Hi @mskvortsov,

May you please provide steps on how you built your working rpi2 image?
I recently tried it out on a FreeBSD 11.1 VM and failed.

I did the following and got errors at the last command:

pkg install git
cd /usr
git clone https://github.com/opnsense/tools
cd tools
make update
pkg install qemu-user-static
make base kernel ARCH=arm:armv6 KERNEL=SMP-RPI2


I eventually got the following error messages at the end of the last make command:

*** [buildworld] Error code 2

make: stopped in /usr/src
1 error

make: stopped in /use/src
Error code 2

Stop.


I noticed it's building the current OPNSense 18.1
Can you suggest steps to fix this error?

Thank you

What error are you seeing? The snippet only shows the build fallout, not the actual error message.


Cheers,
Franco

Hi Franco,

Sorry I didn't include the entire log last time.

Hope you can shed some light and help me with this.

Below is the entire log of the error.

Thank you


cc1_main.o: In function `cc1_main(llvm::ArrayRef<char const*>, char const*, void*)':
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x3f4): relocation truncated to fit: R_ARM_CALL against symbol `llvm::install_fatal_error_handler(void (*)(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool), void*)' defined in .text._ZN4llvm27install_fatal_error_handlerEPFvPvRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbES0_ section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(ErrorHandling.o)
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x420): relocation truncated to fit: R_ARM_CALL against symbol `llvm::remove_fatal_error_handler()' defined in .text._ZN4llvm26remove_fatal_error_handlerEv section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(ErrorHandling.o)
cc1_main.o: In function `LLVMErrorHandler(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)':
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._ZL16LLVMErrorHandlerPvRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEb+0x54): relocation truncated to fit: R_ARM_CALL against symbol `llvm::sys::RunInterruptHandlers()' defined in .text._ZN4llvm3sys20RunInterruptHandlersEv section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(Signals.o)
cc1_main.o: In function `_ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerWriterENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_':
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerWriterENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_[_ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerWriterENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_]+0x28): relocation truncated to fit: R_ARM_CALL against symbol `llvm::StringMapImpl::LookupBucketFor(llvm::StringRef)' defined in .text._ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(StringMap.o)
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerWriterENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_[_ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerWriterENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_]+0xc8): relocation truncated to fit: R_ARM_CALL against symbol `llvm::StringMapImpl::RehashTable(unsigned int)' defined in .text._ZN4llvm13StringMapImpl11RehashTableEj section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(StringMap.o)
cc1_main.o: In function `_ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerReaderENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_':
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerReaderENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_[_ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerReaderENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_]+0x28): relocation truncated to fit: R_ARM_CALL against symbol `llvm::StringMapImpl::LookupBucketFor(llvm::StringRef)' defined in .text._ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(StringMap.o)
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerReaderENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_[_ZN4llvm9StringMapINSt3__110unique_ptrIN5clang18PCHContainerReaderENS1_14default_deleteIS4_EEEENS_15MallocAllocatorEE11try_emplaceIJEEENS1_4pairINS_17StringMapIteratorIS7_EEbEENS_9StringRefEDpOT_]+0xc8): relocation truncated to fit: R_ARM_CALL against symbol `llvm::StringMapImpl::RehashTable(unsigned int)' defined in .text._ZN4llvm13StringMapImpl11RehashTableEj section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(StringMap.o)
cc1_main.o: In function `_GLOBAL__sub_I_cc1_main.cpp':
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._GLOBAL__sub_I_cc1_main.cpp+0x34): relocation truncated to fit: R_ARM_CALL against symbol `llvm::createBasicAAWrapperPass()' defined in .text._ZN4llvm24createBasicAAWrapperPassEv section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(BasicAliasAnalysis.o)
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._GLOBAL__sub_I_cc1_main.cpp+0x38): relocation truncated to fit: R_ARM_CALL against symbol `llvm::createSCEVAAWrapperPass()' defined in .text._ZN4llvm23createSCEVAAWrapperPassEv section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(ScalarEvolutionAliasAnalysis.o)
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._GLOBAL__sub_I_cc1_main.cpp+0x3c): relocation truncated to fit: R_ARM_CALL against symbol `llvm::createTypeBasedAAWrapperPass()' defined in .text._ZN4llvm28createTypeBasedAAWrapperPassEv section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(TypeBasedAliasAnalysis.o)
/usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:(.text._GLOBAL__sub_I_cc1_main.cpp+0x40): additional relocation overflows omitted from the output
===> usr.bin/dpv (all)
===> usr.sbin/rtsold (all)
===> usr.bin/ee (all)
===> usr.sbin/traceroute6 (all)
===> usr.sbin/inetd (all)
===> usr.sbin/ipfwpcap (all)
===> usr.sbin/iscsid (all)
/usr/src/usr.sbin/iscsid/chap.c:46:12: warning: unused parameter 'response_len' [-Wunused-parameter]
    size_t response_len)
           ^
1 warning generated.
===> usr.sbin/jail (all)
===> usr.bin/clang/llvm-objdump (all)
===> usr.sbin/jexec (all)
===> usr.sbin/jls (all)
===> usr.sbin/kbdcontrol (all)
===> usr.sbin/kbdmap (all)
===> usr.sbin/moused (all)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
--- clang ---
*** [clang] Error code 1

make[5]: stopped in /usr/src/usr.bin/clang/clang
1 error

make[5]: stopped in /usr/src/usr.bin/clang/clang
--- all_subdir_usr.bin/clang/clang ---
*** [all_subdir_usr.bin/clang/clang] Error code 2

make[4]: stopped in /usr/src/usr.bin/clang
A failure has been detected in another branch of the parallel make

make[5]: stopped in /usr/src/usr.bin/clang/llvm-tblgen
--- all_subdir_usr.bin/clang/llvm-tblgen ---
*** [all_subdir_usr.bin/clang/llvm-tblgen] Error code 2

make[4]: stopped in /usr/src/usr.bin/clang
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/src/usr.sbin/moused
--- all_subdir_usr.sbin/moused ---
*** [all_subdir_usr.sbin/moused] Error code 2

make[3]: stopped in /usr/src/usr.sbin
1 error

make[3]: stopped in /usr/src/usr.sbin
--- all_subdir_usr.sbin ---
*** [all_subdir_usr.sbin] Error code 2

make[2]: stopped in /usr/src
A failure has been detected in another branch of the parallel make

make[5]: stopped in /usr/src/usr.bin/clang/llvm-objdump
--- all_subdir_usr.bin/clang/llvm-objdump ---
*** [all_subdir_usr.bin/clang/llvm-objdump] Error code 2

make[4]: stopped in /usr/src/usr.bin/clang
3 errors

make[4]: stopped in /usr/src/usr.bin/clang
--- all_subdir_usr.bin/clang ---
*** [all_subdir_usr.bin/clang] Error code 2

make[3]: stopped in /usr/src/usr.bin
1 error

make[3]: stopped in /usr/src/usr.bin
--- all_subdir_usr.bin ---
*** [all_subdir_usr.bin] Error code 2

make[2]: stopped in /usr/src
2 errors

make[2]: stopped in /usr/src
--- everything ---
*** [everything] Error code 2

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src
--- buildworld ---
*** [buildworld] Error code 2

make: stopped in /usr/src
1 error

make: stopped in /usr/src
*** Error code 2

Stop.
make: stopped in /usr/tools

"The problem seems to be the php70-7.0.24 package is broken on armv6: /usr/local/bin/php enters infinite loop because of invalid elf relocations (a toolchain bug?). If I downgrade php70-* packages to the prebuilt 7.0.7 versions from http://pkg.freebsd.org/FreeBSD:11:armv6/release_0/All, OPNSense boots successfully on RPI2:"

Is downgrade automatic or does it have to be manual? What procedure?

We use PHP 7.1 nowadays. No idea if it's fixed. It takes a lot of nerve to build a proper arm version still. :/