assembler (mips) as: unrecognized option -EL SOLVED

Kris
 
Posts: 10
Joined: Tue Dec 01, 2015 12:59 pm
Location: Sydney

assembler (mips) as: unrecognized option -EL SOLVED

Sat Jul 16, 2016 4:43 pm

Trying to compile famous "hello word" for VoCore tiny computer to learn how to use it as robot.
I guess as (assembler) comes with message:
as: unrecognized option '-EL'

resulting with filed build.

Any ideas, suggestions where the problem is????
Thanks for tour time

Kris
Last edited by Kris on Thu Aug 11, 2016 10:59 am, edited 1 time in total.

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: assembler (mips) as: unrecognized option -EL

Mon Jul 18, 2016 12:36 am

Please paste the full log :)

Kris
 
Posts: 10
Joined: Tue Dec 01, 2015 12:59 pm
Location: Sydney

Re: assembler (mips) as: unrecognized option -EL

Tue Jul 19, 2016 3:36 pm

Vonger wrote:Please paste the full log :)


There it is the log from. I am showing Makefile and the output from build.
I found -El in line 40, somwhere in middle of it.
Now got stuck ..... with
collect2
aas you can see at the end .... cannot find ld ....... what is happening ???

Thanks for your time Kris

Code:
kris@fx4 ~/opt/mips/programs $ less Makefile
INCLUDE_PATH=/home/kris/opt/mips/usr/include
SEARCH_DIR=/home/kris/opt/mips/bin
LD=$(SEARCH_DIR)/mips32-ld --verbose

CFLAGS=-g -Wall -Os -S -I$(INCLUDE_PATH)
CC=mips32-gcc

LDFLAGS=-Wl,-gc -Bstatic -L $(LD) -I. $(INCLUDE_PATH)

TARGET=test
OBJECT_FILES=test.o

all:$(TARGET)

test.o: test.c

%obj:$(OBJECT_FILES)

Code:
kris@fx4 ~/opt/mips/programs $ make
mips32-gcc -Wl,-gc -Bstatic -L /home/kris/opt/mips/bin/mips32-ld --verbose -I. /home/kris/opt/mips/usr/include test.o -o test
Using built-in specs.
COLLECT_GCC=mips32-gcc
COLLECT_LTO_WRAPPER=/home/kris/opt/mips/bin/../libexec/gcc/mipsisa32el-unknown-linux-gnu/4.9.4/lto-wrapper
Target: mipsisa32el-unknown-linux-gnu
Configured with: /home/kris/opt/gcc/embtoolkit-1.8.0/build/tools_build-mipsel-linux-mips32/gcc-4.9.3/configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --prefix=/home/kris/opt/gcc/embtoolkit-1.8.0/generated/tools-mipsel-linux-mips32 --with-sysroot=/home/kris/opt/gcc/embtoolkit-1.8.0/generated/sysroot-mipsel-linux-mips32 --target=mipsisa32el-unknown-linux-gnu --with-arch=mips32 --with-abi=32 --with-float=soft --disable-multilib --with-gmp=/home/kris/opt/gcc/embtoolkit-1.8.0/generated/host-tools-mips32/usr --with-mpfr=/home/kris/opt/gcc/embtoolkit-1.8.0/generated/host-tools-mips32/usr --with-mpc=/home/kris/opt/gcc/embtoolkit-1.8.0/generated/host-tools-mips32/usr --enable-target-optspace --disable-libssp --disable-libgomp --disable-libmudflap --disable-nls --disable-libquadmath --with-bugurl=http://bugs.embtoolkit.org/projects/embtoolkit --with-pkgversion=embtoolkit-1.8.0 --enable-languages=c,c++,fortran --enable-threads --enable-shared --enable-__cxa_atexit --disable-symvers
Thread model: posix
gcc version 4.9.4 20150727 (prerelease) (embtoolkit-1.8.0)
COMPILER_PATH=/home/kris/opt/mips/bin/../libexec/gcc/mipsisa32el-unknown-linux-gnu/4.9.4/:/home/kris/opt/mips/bin/../libexec/gcc/
LIBRARY_PATH=/home/kris/opt/mips/bin/../lib/gcc/mipsisa32el-unknown-linux-gnu/4.9.4/:/home/kris/opt/mips/bin/../lib/gcc/
COLLECT_GCC_OPTIONS='-B' 'static' '-L/home/kris/opt/mips/bin/mips32-ld' '-v' '-I' '.' '-o' 'test' '-march=mips32' '-mabi=32' '-msoft-float' '-mllsc' '-mno-shared'
/home/kris/opt/mips/bin/../libexec/gcc/mipsisa32el-unknown-linux-gnu/4.9.4/collect2 -plugin /home/kris/opt/mips/bin/../libexec/gcc/mipsisa32el-unknown-linux-gnu/4.9.4/liblto_plugin.so -plugin-opt=/home/kris/opt/mips/bin/../libexec/gcc/mipsisa32el-unknown-linux-gnu/4.9.4/lto-wrapper -plugin-opt=-fresolution=/tmp/ccJ21HCX.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/home/kris/opt/gcc/embtoolkit-1.8.0/generated/sysroot-mipsel-linux-mips32 --eh-frame-hdr -EL -dynamic-linker /lib/ld.so.1 -o test crt1.o crti.o /home/kris/opt/mips/bin/../lib/gcc/mipsisa32el-unknown-linux-gnu/4.9.4/crtbegin.o -L/home/kris/opt/mips/bin/mips32-ld -L/home/kris/opt/mips/bin/../lib/gcc/mipsisa32el-unknown-linux-gnu/4.9.4 -L/home/kris/opt/mips/bin/../lib/gcc -gc /home/kris/opt/mips/usr/include test.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/kris/opt/mips/bin/../lib/gcc/mipsisa32el-unknown-linux-gnu/4.9.4/crtend.o crtn.o
collect2: fatal error: cannot find 'ld'
compilation terminated.
<builtin>: recipe for target 'test' failed
make: *** [test] Error 1
kris@fx4 ~/opt/mips/programs $

trying to see what lto-wrapper is doing .... and I thing found the problem:

Code:
kris@fx4 ~/opt/mips/libexec/gcc/mipsisa32el-unknown-linux-gnu/4.9.4 $ ldd lto-wrapper
linux-vdso.so.1 (0x00007ffcc3930000)
libm.so.6 => /lib64/libm.so.6 (0x00007f38ac9a2000)
libc.so.6 => /lib64/libc.so.6 (0x00007f38ac606000)
/lib64/ld-linux-x86-64.so.2 (0x00007f38acc98000)

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: assembler (mips) as: unrecognized option -EL

Wed Jul 20, 2016 2:33 am

just use the openwrt toolchain

Kris
 
Posts: 10
Joined: Tue Dec 01, 2015 12:59 pm
Location: Sydney

Re: assembler (mips) as: unrecognized option -EL

Wed Jul 20, 2016 6:54 am

OK ..... Thanks, I am going to try, it should be fine, I hope.

Kris
 
Posts: 10
Joined: Tue Dec 01, 2015 12:59 pm
Location: Sydney

Re: assembler (mips) as: unrecognized option -EL

Fri Jul 29, 2016 2:58 pm

Tried to use SDK - tool chain .... noy much luck, searched the net for manuals, instructions ... etc... did not help.
The Makefile:
CFLAGS=-g -Wall
GCC=/usr/bin/mips-unknown-linux-gnu-gcc-5.4.0 --verbose
LD=/usr/bin/mips-linux-uclibc-ld
AS=/usr/bin/mips-unknown-linux-gnu-as

#LDFLAGS=-Wl,-gc -Bstatic -L$(LD) -I. $(INCLUDE_PATH)
LDFLAGS=-Wl,-gc -Bstatic -L$(LD) -I.

#TARGET=test
#OBJECT_FILES=test.obj

all:

$(GCC) -v test.c

clean:
rm -f *.o *
#.hex *.obj *

#%.hex: %.obj
# $(OBJ2HEX) -R .eeprom -O ihex $< $@

#%.obj: $(OBJECT_FILES)
# $(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@

Code - running make output
kris@fx4 ~/opt/programs $ make
/usr/bin/mips-unknown-linux-gnu-gcc-5.4.0 --verbose -v test.c
Using built-in specs.
COLLECT_GCC=/usr/bin/mips-unknown-linux-gnu-gcc-5.4.0
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/mips-unknown-linux-gnu/5.4.0/lto-wrapper
Target: mips-unknown-linux-gnu
Configured with: /var/tmp/portage/cross-mips-unknown-linux-gnu/gcc-5.4.0/work/gcc-5.4.0/configure --host=x86_64-pc-linux-gnu --target=mips-unknown-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/mips-unknown-linux-gnu/gcc-bin/5.4.0 --includedir=/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/include --datadir=/usr/share/gcc-data/mips-unknown-linux-gnu/5.4.0 --mandir=/usr/share/gcc-data/mips-unknown-linux-gnu/5.4.0/man --infodir=/usr/share/gcc-data/mips-unknown-linux-gnu/5.4.0/info --with-gxx-include-dir=/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/include/g++-v5 --with-python-dir=/share/gcc-data/mips-unknown-linux-gnu/5.4.0/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 5.4.0 p1.0, pie-0.6.5' --enable-libstdcxx-time --enable-poison-system-directories --with-sysroot=/usr/mips-unknown-linux-gnu --disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-altivec --disable-fixed-point --with-abi= --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto --without-isl --enable-libsanitizer
Thread model: posix
gcc version 5.4.0 (Gentoo 5.4.0 p1.0, pie-0.6.5)
COLLECT_GCC_OPTIONS='-v' '-v' '-mllsc' '-mno-shared' '-EB' '-mabi=32'
/usr/libexec/gcc/mips-unknown-linux-gnu/5.4.0/cc1 -quiet -v -v test.c -meb -quiet -dumpbase test.c -mllsc -mno-shared -mabi=32 -auxbase test -version -fstack-protector-strong -o /tmp/ccei5ohD.s
GNU C11 (Gentoo 5.4.0 p1.0, pie-0.6.5) version 5.4.0 (mips-unknown-linux-gnu)
compiled by GNU C version 4.9.3, GMP version 6.0.0, MPFR version 3.1.3-p4, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/mips-unknown-linux-gnu/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/../../../../mips-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/include
/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/include-fixed
/usr/mips-unknown-linux-gnu/usr/include
End of search list.
GNU C11 (Gentoo 5.4.0 p1.0, pie-0.6.5) version 5.4.0 (mips-unknown-linux-gnu)
compiled by GNU C version 4.9.3, GMP version 6.0.0, MPFR version 3.1.3-p4, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0db396b693ca9d953b3a5b53243f0369
COLLECT_GCC_OPTIONS='-v' '-v' '-mllsc' '-mno-shared' '-EB' '-mabi=32'
/usr/libexec/gcc/mips-unknown-linux-gnu/as -v -v -EB -O1 -no-mdebug -mabi=32 -mno-shared -KPIC -o /tmp/ccowFxER.o /tmp/ccei5ohD.s
GNU assembler version 2.25.1 (mips-unknown-linux-gnu) using BFD version (Gentoo 2.25.1 p1.1) 2.25.1
COMPILER_PATH=/usr/libexec/gcc/mips-unknown-linux-gnu/5.4.0/:/usr/libexec/gcc/mips-unknown-linux-gnu/5.4.0/:/usr/libexec/gcc/mips-unknown-linux-gnu/:/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/:/usr/lib/gcc/mips-unknown-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/:/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/../../../../mips-unknown-linux-gnu/lib/:/usr/mips-unknown-linux-gnu/lib/:/usr/mips-unknown-linux-gnu/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-v' '-mllsc' '-mno-shared' '-EB' '-mabi=32'
/usr/libexec/gcc/mips-unknown-linux-gnu/5.4.0/collect2 -plugin /usr/libexec/gcc/mips-unknown-linux-gnu/5.4.0/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/mips-unknown-linux-gnu/5.4.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccWyCx25.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/usr/mips-unknown-linux-gnu --eh-frame-hdr -EB -dynamic-linker /lib/ld.so.1 -melf32btsmip /usr/mips-unknown-linux-gnu/usr/lib/crt1.o /usr/mips-unknown-linux-gnu/usr/lib/crti.o /usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/crtbegin.o -L/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0 -L/usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/../../../../mips-unknown-linux-gnu/lib -L/usr/mips-unknown-linux-gnu/lib -L/usr/mips-unknown-linux-gnu/usr/lib /tmp/ccowFxER.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/mips-unknown-linux-gnu/5.4.0/crtend.o /usr/mips-unknown-linux-gnu/usr/lib/crtn.o

Running a.out on vocore
root@OpenWrt:/# ./a.out
./a.out: line 1: syntax error: unexpected "("

The a.out snippet to see if it is compiled for mips processor:
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x4005a0
Start of program headers: 52 (bytes into file)
Start of section headers: 6368 (bytes into file)
Flags: 0x1007, noreorder, pic, cpic, o32, mips1
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 11
Size of section headers: 40 (bytes)
Number of section headers: 32
Section header string table index: 29

on vocore code
root@OpenWrt:/# ldd ./a.out
libcrypt.so.0 => /lib/libcrypt.so.0 (0x770e9000)
libm.so.0 => /lib/libm.so.0 (0x770c3000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7709f000)
libc.so.0 => /lib/libc.so.0 (0x77033000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x7710d000

Hm .... libraries are there ....

I am really puzzled .... can't see "trees in the woods" any more. What on Earth doing wrong ????

Thanks for your time Kris

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: assembler (mips) as: unrecognized option -EL

Fri Jul 29, 2016 4:34 pm

I guess you are using the wrong toolchain.

1. Install necessary tools:
sudo apt-get install make gcc unzip zlib1g-dev libncurses5-dev gawk subversion libssl-dev git g++

2. Download openwrt
git clone git://git.openwrt.org/openwrt.git

2.1. Get feeds(not necessary unless your need LuCI)
openwrt/scripts/feeds update -a
openwrt/scripts/feeds install luci
(Note: install all, call /Volumes/VoCore/openwrt/scripts/feeds install -a)



3. Make & Compile
goto openwrt folder(git create that), for example: cd ~/openwrt
make menuconfig
(Choose target in the menu list)
make

Kris
 
Posts: 10
Joined: Tue Dec 01, 2015 12:59 pm
Location: Sydney

Re: assembler (mips) as: unrecognized option -EL

Sat Jul 30, 2016 2:44 am

Thanks for input.
The SDK I was trying to use is - without success.
OpenWrt-SDK-15.05.1-x86-64_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2 - i am using Gentoo version of linux, almost since it inception.

OK - I try again version you advised, thanks again and have nice weekend.

Kris
 
Posts: 10
Joined: Tue Dec 01, 2015 12:59 pm
Location: Sydney

Re: assembler (mips) as: unrecognized option -EL

Tue Aug 09, 2016 2:16 pm

Still getting no where .......... installed from git latest SDK, from Makefile you can see.

code:
$less Makefile
STAGING_DIR:=/home/kris/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-5.3.0_glibc-2.22
#CFLAGS=-g -Wall
XGCC=$(STAGING_DIR)/bin/mipsel-openwrt-linux-gnu-gcc-5.3.0
XAS=$(STAGING_DIR)/bin/mipsel-openwrt-linux-gnu-as

#LDFLAGS=-Wl,-gc -Bstatic -L$(LD) -I. $(INCLUDE_PATH)
#LDFLAGS=-Wl,-gc -Bstatic -L$(LD) -I.

all:
$(XGCC) -g test.c -o hello
$(XGCC) -Os -S -o hello_test.s test.c

$(XAS) hello_test.s -o world
clean:
rm -f *.s *.o
Makefile lines 1-20/20 (END)

As you can see building in two ways, file "world" is assembler output.
copied to VoCore and one of them can not be found, other one comes with error:
root@OpenWrt:~# ./hello
-ash: ./hello: not found

root@OpenWrt:~# ./world
./world: line 1: syntax error: unexpected word (expecting ")")

root@OpenWrt:~# ls -l
-rwxr-xr-x 1 root root 7152 Sep 8 20:17 hello
-rwxr-xr-x 1 root root 1504 Sep 8 20:19 world

On build machine (Gentoo Linux);

kris@fx4 ~/openwrt/package/mytest $ file hello
hello: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked, interpreter /lib/ld.so.1, for GNU/Linux 2.6.32, not stripped

kris@fx4 ~/openwrt/package/mytest $ file world
world: ELF 32-bit LSB relocatable, MIPS, MIPS-I version 1 (SYSV), not stripped

kris@fx4 ~/openwrt/package/mytest $ ldd hello
not a dynamic executable

kris@fx4 ~/openwrt/package/mytest $ ldd world
not a dynamic executable

Why file "hello" is made as interpreter ???? still executable. asking for /lib/ld.so.1
while file "world" is made as SYSV .... ????

Am I not seeing "woods in the forrest" any ideas ????

Thanks for your time, regards Kris

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: assembler (mips) as: unrecognized option -EL

Tue Aug 09, 2016 10:55 pm

It will be going back to square one but I recommend doing this. It will get you familiar with how the openwrt setup works and is based on a fixed, stable release. The only change I would make is to use 15.05.01 instead of 15.05. 15.05.01 is bug fix release.

Once you get that going try moving to trunk. Trunk is a constantly changing target so you can run into strange things.

I know my instructions work I have repeated those steps several times. I use it as a reference.when my poor memory eats a. Important step. If you follow those I'll be able (and glad) to help you figure out what went wrong.

I hate precompiled SDK s they come with a set of requirements/expectations/limitations that may not be well documented.

Next
Return to VoCore & VoCore+Dock

Who is online

Users browsing this forum: Google [Bot] and 39 guests