Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant compile /usr/local/m68k-elf/bin/gcc: 1: Syntax error: "(" unexpected #5513

Closed
TheRealBard opened this issue Jun 30, 2020 · 10 comments
Closed

Comments

@TheRealBard
Copy link

Environment

OS Build 19041.329
Ubuntu 20.04
Linux version 4.4.0-19041-Microsoft ([email protected]) (gcc version 5.4.0 (GCC) ) #1-Microsoft Fri Dec 06 14:06:00 PST 2019

Steps to reproduce

make

Expected behavior

bmt@ubuntu:~/Linux/work/test$ make
tbsound -l snd.spec sounds.bin -m gamesounds.h
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ globals.c -o globals.o
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ main.c -o main.o
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ game.c -o game.o
game.c:126: warning: void DoSelectGame()' defined but not used game.c:179: warning: void DoBatteriesInstalled()' defined but not used
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ sounds.c -o sounds.o
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ input.c -o input.o
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ nrrc.c -o nrrc.o
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ pwm.c -o pwm.o
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ timer.c -o timer.o
/usr/local/m68k-elf/bin/ld -lapp globals.o main.o game.o sounds.o input.o nrrc.o pwm.o timer.o -L/usr/local/lib/gcc-lib/m68k-elf/3.3.2/m68000 -L../../device/source/libapp -lgcc -Map app.map -T linkfile
mmcimage ../../device/source/os/os.s19 app.s19 sounds.bin >image.bin

Actual behavior

make
/usr/local/m68k-elf/bin/gcc -I../../device/source/include -m68000 -Wunused -Wall -Wa,-m68000 -O2 -c -fno-builtin -fno-exceptions -fomit-frame-pointer -fmessage-length=0 -x c++ globals.c -o globals.o
/usr/local/m68k-elf/bin/gcc: 1: Syntax error: "(" unexpected
make: *** [Makefile:22: globals.o] Error 2

@TheRealBard
Copy link
Author

I have been running a gcc compiler for an old tool chain, m68k-elf on an Ubuntu VM for years. With wsl2, I thought I would try to go native. I installed binutils, make, and copied all the installation directories over from a working image.
When I run make, it throws a syntax error. Its a working project so it's not that. It's something else. I'm not into linux so I cant help but to say I will try to follow steps if you can go kinda slow.

@therealkenc
Copy link
Collaborator

therealkenc commented Jun 30, 2020

make is not a repro. You could in the hypothetical entertain posting repro steps leading to your error, but the probability of arriving at a syscall diverge here is.... low.

@TheRealBard
Copy link
Author

I dont follow. sycall diverge?

@therealkenc
Copy link
Collaborator

sycall diverge?

A problem with WSL1's implementation of the Linux kernel. As opposed to a problem in userspace.

@therealkenc
Copy link
Collaborator

I might be able to guess without a repro. Post the result of:

$ file /usr/local/m68k-elf/bin/gcc

@TheRealBard
Copy link
Author

file /usr/local/m68k-elf/bin/gcc
/usr/local/m68k-elf/bin/gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, not stripped

I installed the toolchain with guidance from a guy who knows it real well. I installed binutils, then make, then copied the tree of files into place that he had prepared off his own machine. I have it in a .tgz file, but it's like 9mb. not sure if a link to that would be useful. Then try to make a known good project.

@therealkenc
Copy link
Collaborator

/usr/local/m68k-elf/bin/gcc: ELF 32-bit LSB executable

That was the guess. This is actually a diverge of sorts; 32-bit binaries are not supported on WSL1. Happily you are on 19041 aka 2004 aka 20H1: you want WSL2.

/dupe #2468 dating back to #228.

@ghost
Copy link

ghost commented Jun 30, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@ghost ghost added the duplicate label Jun 30, 2020
@TheRealBard
Copy link
Author

ah.. i had no idea I was on 1.. Strange, I thought it just came with 2004.. they should mark it or something.

@therealkenc
Copy link
Collaborator

they should mark it or something

wsl.exe -l -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants