Solved Cross-compiling NanoBSD for embedded application

Hello, dear colleagues.

I have an installed FreeBSD 10.0-RELEASE-p12 #0 r274481 on one of my servers with an amd64 kernel. Now I want to compile NanoBSD from /usr/src/tools/tools/nanobsd for this board: http://www.icop.com.tw/en/product/PC104-Module-VDX-6357RD-800MHz/VDX-6357RD.html This board has an x86-compatible processor on it so I have to compile NanoBSD with an i386 kernel. The problem is that I have this error while compiling:
Code:
c++ -O2 -pipe -I/usr/src/usr.bin/clang/tblgen/../../../contrib/llvm/include -I/usr/src/usr.bin/clang/tblgen/../../../contrib/llvm/tools/clang/include -I/usr/src/usr.bin/clang/tblgen/../../../contrib/llvm/utils/TableGen -I. -I/usr/src/usr.bin/clang/tblgen/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG -fno-strict-aliasing -DLLVM_DEFAULT_TARGET_TRIPLE=\"i386-unknown-freebsd10.0\" -DLLVM_HOST_TRIPLE=\"x86_64-unknown-freebsd10.0\" -DDEFAULT_SYSROOT=\"\" -I/usr/obj/nanobsd.vortex//i386.i386/usr/src/tmp/legacy/usr/include -Wno-c++11-extensions -fno-exceptions -fno-rtti  -static -L/usr/obj/nanobsd.vortex//i386.i386/usr/src/tmp/legacy/usr/lib -o tblgen AsmMatcherEmitter.o AsmWriterEmitter.o AsmWriterInst.o CTagsEmitter.o CallingConvEmitter.o CodeEmitterGen.o CodeGenDAGPatterns.o CodeGenInstruction.o CodeGenMapTable.o CodeGenRegisters.o CodeGenSchedule.o CodeGenTarget.o DAGISelEmitter.o DAGISelMatcher.o DAGISelMatcherEmitter.o DAGISelMatcherGen.o DAGISelMatcherOpt.o DFAPacketizerEmitter.o DisassemblerEmitter.o FastISelEmitter.o FixedLenDecoderEmitter.o InstrInfoEmitter.o IntrinsicEmitter.o OptParserEmitter.o PseudoLoweringEmitter.o RegisterInfoEmitter.o SetTheory.o SubtargetEmitter.o TGValueTypes.o TableGen.o X86DisassemblerTables.o X86ModRMFilters.o X86RecognizableInstr.o /usr/obj/nanobsd.vortex//i386.i386/usr/src/tmp/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmtablegen/libllvmtablegen.a /usr/obj/nanobsd.vortex//i386.i386/usr/src/tmp/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmsupport/libllvmsupport.a -legacy
/usr/bin/ld: cannot find -legacy
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [tblgen] Error code 1
I thought it's because I hadn't any support for building i386 applications and I tried to follow someone's advice to do make toolchain but with no success. What am I doing wrong? Thanks for the advice.

Anton.
 
Hi there!

I have found solution in other thread: http://ru-freebsd.livejournal.com/191566.html?thread=1607502 (in Russian language). The main idea of thread is that one man couldn't build world with static library "libegacy.a". And he was answered that he should put a key "WITHOUT_INSTALLIB=" from "CONF_BUILD" section to "CONF_INSTALL" one. That was helped me too. Now I have another problem with building nanobsd but it's a matter of another topic.

Best regards, Anton.
 
I've been cross compiling NanoBSD i386 on an amd64 host and haven't seen that issue. I did use amd64 for a bit but switched to i386 when I found a few things didn't work on my Soekris box. It does have a 32 bit processor after all but there are a few sites out there that say it works just fine. I switched to 10.0-STABLE on it 2-3 months ago and haven't seen an issue like you described. Your issue may be specific to 10.0-RELEASE and fixed later on.
 
Back
Top