FS#54814 - [sdcc] sdld segfaults when trying to link any

Attached to Project: Community Packages
Opened by jem (jem) - Friday, 14 July 2017, 23:06 GMT
Last edited by Kyle Keen (keenerd) - Saturday, 15 September 2018, 02:41 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description:
The SDCC linker segfaults in libc when trying to link any object files.
There's no segfault when using sdcc 3.6.0-3, or using sdcc compiled from upstream sources (svn-#9948)

Additional info:
sdcc 3.6.0-4

Steps to reproduce:

Try to compile a project that has any two *.c files and try to link them. For example

sdcc -c a.c
sdcc -c main.c
sdcc a.rel main.rel -o main.hex

Causes the follwing segfault in sdld:

sdld[12227]: segfault at ff7c820 ip 00007f1b1da0a8c6 sp 00007ffef70c00b8 error 4 in libc-2.25.so[7f1b1d988000+19d000]


This task depends upon

Closed by  Kyle Keen (keenerd)
Saturday, 15 September 2018, 02:41 GMT
Reason for closing:  Fixed
Additional comments about closing:  sdcc 3.7.0
Comment by mickael9 (mickael9) - Saturday, 15 July 2017, 17:17 GMT
I also noticed this problem. I believe this is fixed by revision #9119: https://sourceforge.net/p/sdcc/code/9119/

The problem is that -std=c99 removes the definition of strdup, so GCC considers that it returns an int and proceeds to strip the topmost 32bits of its result, leading to a crash.
Comment by Uffe Jakobsen (uffe) - Tuesday, 01 August 2017, 10:14 GMT
I have run into the same problem (sdld segfault)

AUR package sigrok-firmware-fx2lafw (https://aur.archlinux.org/packages/sigrok-firmware-fx2lafw) cannot build anymore.

Here is an observation:

With the previous sdcc package (sdcc-3.6.0-3-x86_64.pkg.tar.xz) the builds completes as it should...
But with the latest sdcc package (sdcc-3.6.0-4-x86_64.pkg.tar.xz) the build segfaults in sdld...


Comment by Uffe Jakobsen (uffe) - Tuesday, 01 August 2017, 10:18 GMT
PS: I've used the packages here https://archive.archlinux.org/packages/s/sdcc/
Comment by Matej Špindler (MatejSpindler) - Saturday, 18 November 2017, 14:13 GMT
I'm trying to compile:
https://github.com/zerog2k/stc_diyclock

and I get Segmentation fault.

Downgrading to sdcc-3.6.0-3 also solves the problem.


Comment by Balló György (City-busz) - Sunday, 07 January 2018, 21:26 GMT

Loading...