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

Cannot compile v1.9 under cygwin #3116

Closed
gradoj opened this issue May 26, 2017 · 7 comments
Closed

Cannot compile v1.9 under cygwin #3116

gradoj opened this issue May 26, 2017 · 7 comments

Comments

@gradoj
Copy link

gradoj commented May 26, 2017

I'm having trouble compiling v1.9 using cygwin. I don't have any trouble with 1.8.7. Any help appreciated:

mkdir -p build-PYBV11/usbdev/core/src/ MPY modules/lcd160cr.py MPY modules/lcd160cr_test.py Create stmconst build-PYBV11/genhdr/modstm_const.h Traceback (most recent call last): File "modules/lcd160cr.py", line 1 SyntaxError: invalid syntax Traceback (most recent call last): File "modules/lcd160cr_test.py", line 1 SyntaxError: invalid syntax make: *** [../py/mkrules.mk:117: build-PYBV11/frozen_mpy/lcd160cr.mpy] Error 1 make: *** Waiting for unfinished jobs.... make: *** [../py/mkrules.mk:117: build-PYBV11/frozen_mpy/lcd160cr_test.mpy] Error 1 Create build-PYBV11/pins_PYBV11.c
I deleted LCD160cr.py cause I do not need it but I then get:

CC ../py/../lib/utils/printf.c Creating build-PYBV11/frozen_mpy.c CC ../lib/libc/string0.c CC ../lib/libm/math.c CC ../lib/libm/thumb_vfp_sqrtf.c usage: mpy-tool.py [-h] [-d] [-f] [-q QSTR_HEADER] [-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N] files [files ...] mpy-tool.py: error: the following arguments are required: files make: *** [../py/mkrules.mk:122: build-PYBV11/frozen_mpy.c] Error 2 make: *** Deleting file 'build-PYBV11/frozen_mpy.c' make: *** Waiting for unfinished jobs....

@dpgeorge
Copy link
Member

This is a duplicate of #2961: symlinks don't work on cygwin so you either need to copy the files (in this case lcd160cr.py) or delete them. After deleting them (everything in stmhal/modules/) try doing "make clean", then it should work.

@dpgeorge dpgeorge changed the title Cannot compile v1.9 Cannot compile v1.9 under cygwin May 27, 2017
@gradoj
Copy link
Author

gradoj commented May 27, 2017

I will have to compile on a linux machine. I get the errors above if I leave or delete the py sym link file and I get this linking problem if I copy the files from drivers into the module directory:

CC build-PYBV11/frozen_mpy.c
LINK build-PYBV11/firmware.elf
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `arm-none-eabi-ld -nostdlib -L boards -T boards/stm32f405.ld -Map=build-PYBV11/firmware.map --cref --gc-sections -o build-PYBV11/firmware.elf build-PYBV11/py/mpstate.o build-PYBV11/py/nlrx86.o build-PYBV11/py/nlrx64.o build-PYBV11/py/nlrthumb.o....

@dpgeorge
Copy link
Member

To completely disable the frozen bytecode, try running the following (in stmhal/ dir):

$ make FROZEN_MPY_DIR=

If it still fails, please run make V=1 FROZEN_MPY_DIR= and report the results.

@gradoj
Copy link
Author

gradoj commented May 28, 2017

Looks like i'm getting the same linker error as above. I also upgraded the compiler to the latest 6.3.1 feb 2017 with no change. Attached verbose output.

output.txt

@dpgeorge
Copy link
Member

The issue is that your libgcc.a exists in directory with "(" and ")" in it, namely c:/program files (x86)/gnu tools arm embedded/6 2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/thumb/v7e-m/fpv4-sp/hard/libgcc.a. This filename needs to be correctly quoted and/or escaped for it to work. (This wasn't an issue in v1.8.7 because libgcc.a was not used in that version.)

You can try changing line 64 of stmhal/Makefile to have quotes like this:

LIBS = "$(shell $(CC) $(CFLAGS) -print-libgcc-file-name)"

Otherwise, if this doesn't work, try changing this line to simply LIBS = . You don't really need the library.

@gradoj
Copy link
Author

gradoj commented May 29, 2017

The quotes worked for me. Thanks.

LIBS = "$(shell $(CC) $(CFLAGS) -print-libgcc-file-name)"

@gradoj gradoj closed this as completed May 29, 2017
@revyte
Copy link

revyte commented Jun 7, 2017

Just want to add, if you enable symlinks -c core.symlinks=true while cloning the repo I'm able to successfully compile.

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

Successfully merging a pull request may close this issue.

3 participants