UnixOSProcessPlugin linker error

Mike Roberts mike at mjr104.co.uk
Wed Nov 12 00:50:31 UTC 2003


Hi all,

I'm trying to build the UnixOSProcessPlugin on Linux in a fresh VM that I am also building.  I am getting a linker error so I thought I would run this past you.  Any pointers would be great.

These are roughly the steps I have done.

1) use CVS to get the source tree from sf.net
2) use a pre-built unix VM, latest 3.6 image 
3) load OSPP and VMMaker from SM
4) use VMMaker to build the src directory
5) use make all internal
6) outside the image, run make in platforms/unix/config/ to do some autoconf stuff
7) in platforms/unix/build run ../configure --prefix=$HOME
8) run make

now prior to using the UnixOSProcessPlugin, this all works fine and I am able to run the new VM.  I've used the frame buffer support as well.  This is great!

However, with OSPP there is a linker error for a few functions like openXDisplay and forgetXDisplay.

I've made sure I've updated everything from SM.  I'm not using 3.7 yet because this bombs out sometimes with my new VMs.  (I'll chase this up next)

I've had a look at the source for both the plugin and the display code and it all seems ok at a glance.  It does seem to be a linker issue.

the function is defined as 
extern int foo()

Looking at the makefile I think the VM and plugin code gets linked together first statically.  Then the plugins target gets built next and this should contain the functions that I'm after.

I'm not getting this far though.  The $(LINK) line is failing.  I can build the plugins target manually and this works.

I am not sure how dynamic linking works so I don't know how to expect the functions to be declared.

Am I right in thinking along these lines?  I'm filling in a lot of the holes in my understanding as I go along.

Here is the compiler error

UnixOSProcessPlugin/UnixOSProcessPlugin.a(UnixOSProcessPlugin.o)(.text+0x3d8): In function `forkSqueakWithDisplayEnabled':
/home/mike/src/squeak-m/src/vm/intplugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c:523: undefined reference to `synchronizeXDisplay'
UnixOSProcessPlugin/UnixOSProcessPlugin.a(UnixOSProcessPlugin.o)(.text+0x413):/home/mike/src/squeak-m/src/vm/intplugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c:527: undefined reference to `forgetXDisplay'
UnixOSProcessPlugin/UnixOSProcessPlugin.a(UnixOSProcessPlugin.o)(.text+0x420):/home/mike/src/squeak-m/src/vm/intplugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c:529: undefined reference to `openXDisplay'
collect2: ld returned 1 exit status

and this is some grep

platforms/unix/vm-display-fbdev/sqUnixFBDev.c:void openXDisplay(void)           {}
platforms/unix/vm-display-X11/sqUnixX11.c:int openXDisplay(void)
platforms/unix/vm-display-X11/sqUnixX11.c:    openXDisplay();
src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c:    extern int openXDisplay();
src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c:                  openXDisplay();


I've quickly checked that if you make the plugin external then it all builds.

Cheers

Mike



More information about the Squeak-dev mailing list