This topic contains 40 replies, has 2 voices, and was last updated by rich 9 years, 7 months ago.
-
AuthorPosts
-
January 30, 2014 at 9:25 pm #1510
TrentHi,
I’m having a lot of trouble installing ellcc.
Given a blank install of a VM of a linux distribution,What are the steps that will give me a working ellcc?
Every attempt I have done so far has been plauged with compile errors and missing commands.February 3, 2014 at 7:52 pm #1520Hi Trent,
Could you post the errors you’re getting? I suspect your build is failing during the GNU part of the build because of some missing packages.
-Rich
February 4, 2014 at 8:52 am #1525
TrentAs a base system I’m using an Ubuntu 13.10 amd64 minimal server install, on top of this I installed these packages through trial and error (missing commands or libraries in config scripts etc while running build)
“pkg-config flex bison libncurses5-dev zlib1g-dev libglib2.0-dev autoconf libtool texinfo groff”However the error that it now gives me seems to be while compiling musl
y.tab.c:1447:16: error: implicit declaration of function ‘yylex’ is invalid in C99
[-Werror,-Wimplicit-function-declaration]
yychar = YYLEX;
^
y.tab.c:770:16: note: expanded from macro ‘YYLEX’
# define YYLEX yylex (&yylval, yyInput)
^
y.tab.c:2019:7: error: implicit declaration of function ‘yyerror’ is invalid in C99
[-Werror,-Wimplicit-function-declaration]
yyerror (param, yyInput, YY_(“syntax error”));
^
src/bsd/parsedate.y:570:1: error: static declaration of ‘yyerror’ follows non-static declaration
yyerror(struct dateinfo *param, const char **inp, const char *s)
^
y.tab.c:2019:7: note: previous implicit declaration is here
yyerror (param, yyInput, YY_(“syntax error”));
^
src/bsd/parsedate.y:801:1: error: static declaration of ‘yylex’ follows non-static declaration
yylex(YYSTYPE *yylval, const char **yyInput)
^
y.tab.c:1447:16: note: previous implicit declaration is here
yychar = YYLEX;
^
y.tab.c:770:16: note: expanded from macro ‘YYLEX’
# define YYLEX yylex (&yylval, yyInput)
^
4 errors generated.
make[1]: *** [src/bsd/parsedate.o] Error 1
make[1]: Leaving directory `/home/build/ellcc/libecc/src/musl’
make: *** [arm] Error 1February 4, 2014 at 7:08 pm #1526
GordonHi, I also tried installing on Ubuntu 64 bit 13.10, and had to install g++ and zlibs (I found this installed zlibs:
sudo apt-get –no-install-recommends -y build-dep qemu
)However, after building for 3 hours it crashed: (Console tail follows)
ecc: /home/gordon/Applications/ellcc/llvm/lib/Analysis/LoopInfo.cpp:355: void llvm::Loop::getUniqueExitBlocks(llvm::SmallVectorImpl<llvm::BasicBlock*>&) const: Assertion `hasDedicatedExits() && “getUniqueExitBlocks assumes the loop has canonical form exits!”‘ failed.
0 ecc 0x00000000023d8b40 llvm::sys::PrintStackTrace(_IO_FILE*) + 32
1 ecc 0x00000000023d8774
2 libpthread.so.0 0x00002b460acf9bb0
3 libc.so.6 0x00002b460bb88f77 gsignal + 55
4 libc.so.6 0x00002b460bb8c5e8 abort + 328
5 libc.so.6 0x00002b460bb81d43
6 libc.so.6 0x00002b460bb81df2
7 ecc 0x000000000217b1c1
8 ecc 0x0000000001f845af
9 ecc 0x000000000218548f llvm::LPPassManager::runOnFunction(llvm::Function&) + 1375
10 ecc 0x00000000022c1963 llvm::FPPassManager::runOnFunction(llvm::Function&) + 643
11 ecc 0x00000000020f7525
12 ecc 0x00000000022c221b llvm::legacy::PassManagerImpl::run(llvm::Module&) + 795
13 ecc 0x00000000009ccfcf clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 2751
14 ecc 0x00000000009c82ce
15 ecc 0x0000000000b4d84b clang::ParseAST(clang::Sema&, bool, bool) + 491
16 ecc 0x00000000009c936d clang::CodeGenAction::ExecuteAction() + 77
17 ecc 0x0000000000845419 clang::FrontendAction::Execute() + 249
18 ecc 0x0000000000824a30 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 352
19 ecc 0x000000000080da79 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1753
20 ecc 0x00000000008072d8 cc1_main(char const**, char const**, char const*, void*) + 1256
21 ecc 0x00000000007e8f06 main + 614
22 libc.so.6 0x00002b460bb73de5 __libc_start_main + 245
23 ecc 0x00000000008060b2
Stack dump:
0. Program arguments: /home/gordon/Applications/ellcc/bin/ecc -cc1 -triple armv7-ellcc-linux-eabi -S -disable-free -main-file-name hash.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu cortex-a8 -target-feature +soft-float-abi -target-feature +vfp2 -target-feature -neon -target-abi aapcs -mfloat-abi soft -target-linker-version 2.23.52.20130913 -coverage-file /tmp/hash-09bc46.s -resource-dir /home/gordon/Applications/ellcc/bin/../libecc -dependency-file hash.d -MT hash.o -sys-header-deps -MP -D _XOPEN_SOURCE=700 -D _GNU_SOURCE -D dl_info=Dl_info -I ../../../../src/c++/libcxxabi/include -O1 -std=c++11 -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /home/gordon/Applications/ellcc/libecc/obj/arm/linux/c++ -ferror-limit 19 -fmessage-length 110 -mstackrealign -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /tmp/hash-09bc46.s -x c++ ../../../../src/c++/libcxx/src/hash.cpp
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass ‘CallGraph Pass Manager’ on module ‘../../../../src/c++/libcxx/src/hash.cpp’.
4. Running pass ‘Loop Pass Manager’ on function ‘@_ZNSt3__112__next_primeEj’
5. Running pass ‘Loop Invariant Code Motion’ on basic block ‘%while.body’
ecc: error: unable to execute command: Aborted (core dumped)
ecc: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.5 (trunk)
Target: arm-ellcc-linux-eabi
Thread model: posix
ecc: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
ecc: note: diagnostic msg:
********************PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
ecc: note: diagnostic msg: /tmp/hash-b3b7c5.cpp
ecc: note: diagnostic msg: /tmp/hash-b3b7c5.sh
ecc: note: diagnostic msg:********************
make[4]: *** [hash.o] Error 254
make[4]: Leaving directory `/home/gordon/Applications/ellcc/libecc/obj/arm/linux/c++’
make[3]: *** [install] Error 1
make[3]: Leaving directory `/home/gordon/Applications/ellcc/libecc/obj/arm/linux’
make[2]: *** [install] Error 1
make[2]: Leaving directory `/home/gordon/Applications/ellcc/libecc/obj/arm’
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/gordon/Applications/ellcc/libecc/obj’
make: *** [other-libs] Error 2Not sure if I should start again (as I interrupted it during the first pass).
Is there an environment ellcc is tested to build in? – Any virtual machine images that have it working? I’ve failed to make much progress with Mavericks, and latest Ubuntu while being more promising so far still doesn’t make it.
February 5, 2014 at 11:41 am #1527Hi Gordon,
That turned out to be a bug in LLVM that was subsequently fixed: http://llvm.org/bugs/show_bug.cgi?id=18643
The fix has been incorporated in ELLCC.
The good news is that you’re almost there. You are building the runtime libraries.
You can get to a better place by
cd ellcc # Get the latest sources/ svn update # Build a new compiler. cd llvm-build make install # Build the libraries. cd ../libecc make
-Rich
February 6, 2014 at 2:27 am #1533
GordonHi Rich, getting closer, building cleanly on 12.04LTS to try to minimize any new unsupported wrinkles. I have the following message to contend with:
make[2]: Entering directory `/home/gordon/Applications/ellcc/libecc/expat-build/arm/linux’
/bin/bash ./libtool –silent –mode=compile /home/gordon/Applications/ellcc/libecc/../bin/ecc -target arm-ellcc-linux-eabi -march=armv7 -mfpu=vfp -mfloat-abi=softfp -no-integrated-as -g -Qunused-arguments -Wno-unneeded-internal-declaration -Wno-cast-align -Wno-incompatible-pointer-types -Wno-string-plus-int -Wno-pointer-sign -Wno-array-bounds -Wno-dangling-else -Wno-int-to-pointer-cast -I../../../src/expat/lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o lib/xmlparse.lo -c ../../../src/expat/lib/xmlparse.c
../../../src/expat/lib/xmlparse.c:83:2: error: memmove does not exist on this
platform, nor is a substitute available
#error memmove does not exist on this platform, nor is a substitute available
^
1 error generated.
make[2]: *** [lib/xmlparse.lo] Error 1
make[2]: Leaving directory `/home/gordon/Applications/ellcc/libecc/expat-build/arm/linux’
make[1]: *** [arm.expat.build] Error 2February 6, 2014 at 5:08 am #1534Hi Gordon,
Update one more time:
cd ellcc # Get the latest sources/ svn update # Build the libraries. cd ../libecc make
-Rich
February 6, 2014 at 5:51 am #1535
Gordonmade without error – progressing to next step – thx 🙂
February 6, 2014 at 3:52 pm #1536
GordonHi Rich, i built again, and it seemed to work ok,
Then i went to make check, which mostly worked, but had the following errors, just wondering if these are lint in the tests, or there are some problems I still need to chase:
********************
Testing Time: 109.24s
********************
Failing Tests (9):
LLVM :: BugPoint/crash-narrowfunctiontest.ll
LLVM :: BugPoint/metadata.ll
LLVM :: BugPoint/remove_arguments_test.ll
LLVM :: Feature/load_module.ll
LLVM :: LTO/cfi_endproc.ll
LLVM :: LTO/current-section.ll
LLVM :: LTO/linkonce_odr_func.ll
LLVM :: LTO/runtime-library.ll
LLVM :: LTO/triple-init.llExpected Passes : 9611
Expected Failures : 54
Unsupported Tests : 35
Unexpected Failures: 9
make[2]: *** [check-local] Error 1
make[2]: Leaving directory `/home/gordon/Applications/ellcc/llvm-build/test’
make[1]: *** [check] Error 2
make[1]: Leaving directory `/home/gordon/Applications/ellcc/llvm-build’
make: *** [check] Error 1February 6, 2014 at 4:59 pm #1537Hi Gordon,
Those failures are expected for ELLCC. I am building everything statically currently and those tests dynamically load stuff. Don’t worry about them right now. Eventually we’ll build the shared libraries also.
-Rich
February 6, 2014 at 6:34 pm #1538
GordonHi Rich, I get the feeling I’m almost there:
I ran the hello world example:gordon@ubuntu:~/Applications/armwork$ vi hello.c
gordon@ubuntu:~/Applications/armwork$ ../ellcc/bin/ecc -target mips-ellcc-linux hello.c
gordon@ubuntu:~/Applications/armwork$ ../ellcc/bin/qemu-mips a.out
gordon@ubuntu:~/Applications/armwork$ ../ellcc/bin/qemu-mips a.out
hello worldSuccess!! – BUT, then I ran the cross compiler for arm and got this error:
gordon@ubuntu:~/Applications/armwork$ ../ellcc/bin/ecc -target arm-ellcc-linux helloarm.c
/home/gordon/Applications/armwork/../ellcc/bin/ecc-ld: error: Source object /home/gordon/Applications/ellcc/bin/../libecc/lib/arm/linux/libc.a(__libc_start_main.o) has EABI version 0, but target a.out has EABI version 5
/home/gordon/Applications/armwork/../ellcc/bin/ecc-ld: failed to merge target specific data of file /home/gordon/Applications/ellcc/bin/../libecc/lib/arm/linux/libc.a(__libc_start_main.o)Is there a build specific wrinkle for arm?
Gordon
February 6, 2014 at 7:12 pm #1539
GordonI’m trying to specify futher:
gordon@ubuntu:~/Applications/armwork$ ../ellcc/bin/ecc -target arm-ellcc-linux -mcpu=arm926ej-s helloarm.c /home/gordon/Applications/armwork/../ellcc/bin/ecc-ld: error: Source object /home/gordon/Applications/ellcc/bin/../libecc/lib/arm/linux/libc.a(__libc_start_main.o) has EABI version 0, but target a.out has EABI version 5
other command line options like -march and -meabi are either unused or not understood.
I think the EABI version should be 5 for this processor, while the output format is EABI5, the linker believes the object file is EABI0.
(My first real goal is an application to run on a BusyBox linux build running on a arm926ej-s.)
February 7, 2014 at 5:25 am #1540Hi Gordon,
This worked for me:
ellcc/bin/ecc -target arm-ellcc-linux-eabi -march=armv7 -mfpu=vfp -mfloat-abi=softfp -no-integrated-as helloarm.c
I’m not sure why the integrated assembler is failing with the latest LLVM. I’ll look into it.
-Rich
February 7, 2014 at 6:32 am #1541
GordonI don’t understand what’s different:
I tried you command:gordon@ubuntu:~/armwork$ ../ellcc/bin/ecc -target arm-ellcc-linux-eabi -march=armv7 -mfpu=vfp -mfloat-abi=softfp -no-integrated-as helloarm.c
ecc: error: unable to execute command: Executable “arm-elf-as” doesn’t exist!
ecc: error: assembler command failed with exit code 1 (use -v to see invocation)I cut off the last option and got:
gordon@ubuntu:~/armwork$ ../ellcc/bin/ecc -target arm-ellcc-linux-eabi -march=armv7 -mfpu=vfp -mfloat-abi=softfp helloarm.c/home/gordon/armwork/../ellcc/bin/ecc-ld: error: Source object /home/gordon/ellcc/bin/../libecc/lib/arm/linux/libc.a(__libc_start_main.o) has EABI version 0, but target a.out has EABI version 5
/home/gordon/armwork/../ellcc/bin/ecc-ld: failed to merge target specific data of file /home/gordon/ellcc/bin/../libecc/lib/arm/linux/libc.a(__libc_start_main.o)
/home/gordon/armwork/../ellcc/bin/ecc-ld: error: Source object /home/gordon/ellcc/bin/../libecc/lib/arm/linux/libc.a(exit.o) has EABI version 0, but target a.out has EABI version 5
/home/gordon/armwork/../ellcc/bin/ecc-ld: failed to merge target specific data of file /home/gordon/ellcc/bin/../libecc/lib/arm/linux/libc.a(exit.o)
/home/gordon/armwork/../ellcc/bin/ecc-ld: error: Source object /home/gordon/ellcc/bin/../libecc/lib/arm/linux/libc.a(libc.o) has EABI version 0, but target a.out has EABI version 5
/home/gordon/armwork/../ellcc/bin/ecc-ld: failed to merge target specific data of file /home/gordon/ellcc/bin/../libecc/lib/arm/linux/libc.a(libc.o)
/hMaybe I’m missing something…
(What does “-no-integrated-as” do?)
February 7, 2014 at 6:38 am #1542The -no-integrated-as flag tells the compiler not to use the built-in ARM assembler and to use the external (gnu) assembler instead.
Your bin directory should look like this:
[~] dev% ls ellcc/bin arm-elf-as* ecc-nm* llvm-link* qemu-i386* bmake* ecc-objcopy* llvm-mc* qemu-microblaze* bmake.old* ecc-objdump* llvm-mcmarkup* qemu-mips* bugpoint* ecc-ranlib* llvm-nm* qemu-mipsel* c-index-test* ecc-readelf* llvm-objdump* qemu-ppc* clang-check* ecc-size* llvm-ranlib@ qemu-ppc64* clang-format* ecc-strings* llvm-readobj* qemu-ppc64abi32* clang-tblgen* ecc-strip* llvm-rtdyld* qemu-sparc* count* FileCheck* llvm-size* qemu-system-arm* ecc* i386-elf-as* llvm-stress* qemu-system-i386* ecc++@ llc* llvm-symbolizer* qemu-system-microblaze* ecc-addr2line* lli* llvm-tblgen* qemu-system-mips* ecc-ar* lli-child-target* macho-dump* qemu-system-mipsel* ecc-as* llvm-ar* microblaze-elf-as* qemu-system-ppc* ecc-c++filt* llvm-as* mips-elf-as* qemu-system-ppc64* ecc-elfedit* llvm-bcanalyzer* ncurses5-config* qemu-system-sparc* ecc-embedspu* llvm-config* not* qemu-system-x86_64* ecc-gdb* llvm-cov* opt* qemu-x86_64* ecc-gprof* llvm-diff* ppc64-elf-as* sparc-elf-as* ecc-ld* llvm-dis* ppc-elf-as* x86_64-elf-as* ecc-ld.bfd* llvm-dwarfdump* qemu-arm* ecc-lit* llvm-extract* qemu-armeb* [~] dev%
If arm-elf-as isn’t there, try
cd ~/ellcc/gnu/gnu-build/binutils make install
Maybe the install didn’t occur because of your earlier build failures.
-Rich
-
AuthorPosts
You must be logged in to reply to this topic.