BastilleResearch/nrf-research-firmware

Build failure

Closed this issue · 3 comments

pzl commented

running make on this project is failing on Arch linux. Details below:

$ make
sdcc --model-large --std-c99 -c src/main.c -o bin/main.rel
sdcc --model-large --std-c99 -c src/usb.c -o bin/usb.rel
sdcc --model-large --std-c99 -c src/usb_desc.c -o bin/usb_desc.rel
sdcc --model-large --std-c99 -c src/radio.c -o bin/radio.rel
sdcc --xram-loc 0x8000 --xram-size 2048 --model-large bin/main.rel bin/usb.rel bin/usb_desc.rel bin/radio.rel -o bin/dongle.ihx
make: *** [Makefile:15: dongle.bin] Error 1
$ sdcc -v
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.6.0 #9615 (Linux)
published under GNU General Public License (GPL)

$ python --version
Python 2.7.13

$ pip freeze
arrow==0.10.0
bottle==0.12.13
certifi==2017.7.27.1
chardet==3.0.4
click==5.1
colorama==0.3.9
idna==2.6
lockfile==0.12.2
platformio==3.4.1
pyserial==3.4
python-dateutil==2.6.1
pyusb==1.0.0
requests==2.18.4
semantic-version==2.6.0
six==1.10.0
urllib3==1.22

Same here! (on Arch too)

The build fail when call the linker sdld:

sdld -nf bin/dongle.lk
[1] 11999 segmentation fault (core dumped) sdld -nf bin/dongle.lk

dmesg gave me:
sdld[11999]: segfault at ffffffffaec1aa60 ip 00007f22aa118247 sp 00007ffde197d398 error 5 in libc-2.26.so[7f22a9fc1000+1ae000

sdcc -v
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.6.0 #9615 (Linux) published under GNU General Public License (GPL)

@pzl did you managed to solve the issue?

EDIT:

running make on ubuntu 16.04 it works:

dodo@dodo:~/nrf-research-firmware$ make
mkdir -p bin
sdcc --model-large --std-c99 -c src/main.c -o bin/main.rel
sdcc --model-large --std-c99 -c src/usb.c -o bin/usb.rel
sdcc --model-large --std-c99 -c src/usb_desc.c -o bin/usb_desc.rel
sdcc --model-large --std-c99 -c src/radio.c -o bin/radio.rel
sdcc --xram-loc 0x8000 --xram-size 2048 --model-large bin/main.rel bin/usb.rel bin/usb_desc.rel bin/radio.rel -o bin/dongle.ihx
objcopy -I ihex bin/dongle.ihx -O binary bin/dongle.bin
objcopy --pad-to 26622 --gap-fill 255 -I ihex bin/dongle.ihx -O binary bin/dongle.formatted.bin
objcopy -I binary bin/dongle.formatted.bin -O ihex bin/dongle.formatted.ihx

SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/TININative/ds400/hc08/s08/stm8 3.5.0 #9253 (Mar 24 2016) (Linux) published under GNU General Public License (GPL)

Had the same problem on Arch, turns out there is some bug in sdcc 3.6.0-4: https://bugs.archlinux.org/task/54814
The most straighforward fix is to downgrade sdcc to 3.6.0-3.

pzl commented

Confirmed: this is a bug in Arch's packaging of sdcc.