Bug 201674 - swapcontext missing in libc.so.7 - 10.2.-BETA2 amd64
Summary: swapcontext missing in libc.so.7 - 10.2.-BETA2 amd64
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.2-BETA1
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-18 14:01 UTC by hostmaster
Modified: 2015-07-21 02:06 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hostmaster 2015-07-18 14:01:51 UTC
linking miniruby
cont.o: In function `fiber_setcontext':
cont.c:(.text+0x1bbc): undefined reference to `swapcontext'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [miniruby] Error code 1 (ignored)


... so I tried this:

[x.c]
main() { swapcontext(); };

[x.o]
> cc -c -o x.o x.c
x.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main() { swapcontext(); };
^~~~
x.c:1:10: warning: implicit declaration of function 'swapcontext' is invalid in C99 [-Wimplicit-function-declaration]
main() { swapcontext(); };
         ^
2 warnings generated.

[x]
> cc -o x x.o
x.o: In function `main':
x.c:(.text+0xb): undefined reference to `swapcontext'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 hostmaster 2015-07-18 14:06:54 UTC
> uname -a
FreeBSD weasel 10.2-BETA2 FreeBSD 10.2-BETA2 #5 r285668M: Sat Jul 18 05:28:45 EDT 2015     root@weasel:/usr/obj/usr/src/sys/WEASEL  amd64
Comment 2 hostmaster 2015-07-18 14:21:35 UTC
[10.1-STABLE #6 r283530: Mon May 25]
> nm -aD /lib/libc.so.7 | grep swapcontext
00000000000dab60 T __sys_swapcontext
00000000000dab60 W _swapcontext
00000000000455b0 W swapcontext
00000000000455b0 W swapcontext


[10.2-BETA2 #5 r285668M: Sat Jul 18]
> nm -aD /lib/libc.so.7 | grep swapcontext
00000000000dab80 T __sys_swapcontext
00000000000dab80 W _swapcontext
Comment 3 Konstantin Belousov freebsd_committer freebsd_triage 2015-07-20 17:44:58 UTC
(In reply to hostmaster from comment #2)
There were no changes in this area starting from April.

re just checked the BETA2 images, libc is right, the swapcontext symbol is exported as FBSD_1.0 and 1.2 versions.

You should have some local issue.
Comment 4 hostmaster 2015-07-20 19:09:27 UTC
I'm not sure how to understand what "local issues" might refer to

I made svn update from 10-stable and compiled & installed that - i made no changes to userland code, all is "vanilla"

I will try to get more recent svn update to see what might change, if anything
Comment 5 hostmaster 2015-07-20 19:38:41 UTC
it would seem that svn had not deleted files it was supposed to for some reason

I'm not a svn expert by any means, although i expected the "svn update" output
to mean "deleted" when it shows a "D" in the first column - however none of such files were actually deleted, arrgh

original source was rev 275972 on 2014/12/20

first update (the one in question above) was rev 279382 which showed an unresolved conflict at the end, so is it possible that it never finished?

perhaps i should start from scratch with a fresh usr/src ...
Comment 6 hostmaster 2015-07-21 02:05:40 UTC
[10.2-BETA2 #6 r285724M: Mon Jul 20]
> nm -aD /lib/libc.so.7 | grep swapcontext
00000000000dab80 T __sys_swapcontext
00000000000dab80 W _swapcontext
00000000000455f0 W swapcontext
00000000000455f0 W swapcontext

... so indeed the culprit was my inadequate understanding of how subversion works 

thanks for your assistance! :)