Frama-C Bug Tracking System - Frama-C
View Issue Details
0002489Frama-CKernel > libcpublic2020-01-08 20:512020-06-12 08:59
vkraus 
maroneze 
normalminoralways
closedfixed 
x86_64opam
 
Frama-C 21-Scandium 
0002489: unistd.h declares __fc_ttyname but it has no definition
When compiling __fc_runtime.c, I get /usr/bin/ld: __fc_runtime.o:(.data.rel+0x0): undefined reference to `__fc_ttyname' collect2: error: ld returned 1 exit status
gcc -I$(frama-c -print-share-path)/libc -nostdinc -D__FC_MACHDEP_X86_64 -o __fc_runtime.o -c $(frama-c -print-share-path)/libc/__fc_runtime.c (ignore the warnings) echo "int main () { return 0; }" > main.c gcc main.c __fc_runtime.o You should get the error.
gcc version 8.3.0 (debian buster) frama-c version 20.0 (Calcium)
No tags attached.
Issue History
2020-01-08 20:51vkrausNew Issue
2020-01-08 20:51vkrausStatusnew => assigned
2020-01-08 20:51vkrausAssigned To => maroneze
2020-01-08 20:54vkrausNote Added: 0006929
2020-01-15 18:43maronezeNote Added: 0006930
2020-01-15 18:43maronezeStatusassigned => confirmed
2020-01-22 15:47maronezeNote Added: 0006932
2020-01-22 15:47maronezeStatusconfirmed => resolved
2020-01-22 15:47maronezeFixed in Version => Frama-C GIT, precise the release id
2020-01-22 15:47maronezeResolutionopen => fixed
2020-01-22 15:48maronezeNote Edited: 0006932View Revisions
2020-06-12 08:59signolesFixed in VersionFrama-C GIT, precise the release id => Frama-C 21-Scandium
2020-06-12 08:59signolesStatusresolved => closed

Notes
(0006929)
vkraus   
2020-01-08 20:54   
Sorry, the steps are collapsed on a single line. The first command runs from gcc to __fc_runtime.c, and the second from "echo ..." to "> main.c".
(0006930)
maroneze   
2020-01-15 18:43   
Thanks for the report. I believe adding a "unistd.c" file with a non-extern declaration for that symbol should suffice. We'll also add a non-regression test to avoid re-introducing this kind of bug in the future.
(0006932)
maroneze   
2020-01-22 15:47   
(edited on: 2020-01-22 15:48)
Fixed in commit eca7b9d1ec.