Ubuntu compile error

0 views
Skip to first unread message

Paul Bonser

unread,
Aug 9, 2009, 2:27:48 AM8/9/09
to Programming Nu
I'm trying to get Nu compiled in Ubuntu 9.04, and the initial make or
rake makes it most of the way through the process, but upon final
linking, it fails with the following errors (I added some extra paths
to the Makefile in my attempts to get things to work):

gcc objc/block.o objc/bridge.o objc/bridgesupport.o objc/cell.o
objc/class.o objc/enumerable.o objc/extensions.o objc/handler.o
objc/ivars.o objc/macro_0.o objc/macro_1.o objc/match.o objc/
method.o objc/nu.o objc/objc_runtime.o objc/object.o objc/
operator.o objc/overrides.o objc/parser.o objc/pointer.o objc/
protocol.o objc/reference.o objc/regex.o objc/stack.o objc/
super.o objc/swizzles.o objc/symbol.o objc/testhelper.o main/
main.o objc/mach_override.o objc/st.o -g -O2 -o mininush -lm -lpcre
-lreadline -lgnustep-base -L/usr/lib/GNUstep/System/Library/Libraries -
L/usr/lib/gcc/x86_64-gnu/4.3 -lffi -lobjc -Wl,--rpath -Wl,/usr/local/
lib
objc/extensions.o: In function `-[NSString(Nu) evalWithContext:]':
/home/pib/projects/languages/nu/nu/objc/extensions.m:326: undefined
reference to `objc_sync_enter'
/home/pib/projects/languages/nu/nu/objc/extensions.m:328: undefined
reference to `objc_sync_exit'
/home/pib/projects/languages/nu/nu/objc/extensions.m:328: undefined
reference to `objc_sync_exit'
objc/operator.o: In function `-[Nu(synchronized)
operator::callWithArguments:context:]':
/home/pib/projects/languages/nu/nu/objc/operator.m:579: undefined
reference to `objc_sync_enter'
/home/pib/projects/languages/nu/nu/objc/operator.m:587: undefined
reference to `objc_sync_exit'
/home/pib/projects/languages/nu/nu/objc/operator.m:587: undefined
reference to `objc_sync_exit'
collect2: ld returned 1 exit status
make: *** [mininush] Error 1

Where are these objc_sync_* functions supposed to be coming from?
libobjc is being linked in, so they aren't there. Has anyone run into
this before, or does anyone have any suggestions for how to fix this?

Tim Burks

unread,
Aug 9, 2009, 11:01:12 AM8/9/09
to program...@googlegroups.com

Hi Paul,

It's related to the @synchronized blocks in extensions.m and operator.m.

To get past this, you can comment out those wrappers like this:

// @synchronized(parser) {
body = [parser parse:expression];
// }

Jeff Buck has been working with a Debian port and may be able to point
us to a version of GNUstep and the GNU ObjC libraries that supports
this.

Tim

Paul Bonser

unread,
Aug 9, 2009, 2:46:26 PM8/9/09
to program...@googlegroups.com
Thanks for the reply!

On Sun, Aug 9, 2009 at 10:01 AM, Tim Burks <timb...@gmail.com> wrote:


Hi Paul,

It's related to the @synchronized blocks in extensions.m and operator.m.

To get past this, you can comment out those wrappers like this:

// @synchronized(parser) {
                    body = [parser parse:expression];
//  }

Yep, that fixed it, and I was able to build mininush.

To get nush to build completely, I had to both add "-fPIC into the "(set @cflags.." section of the Nukefile and re-configure and re-make pcre with the --with-pic option. I think this is pretty standard for x86_64 Linux, having to use -fPIC everywhere.
 


Jeff Buck has been working with a Debian port and may be able to point
us to a version of GNUstep and the GNU ObjC libraries that supports
this.

Great, hopefully that gets added soon. Basically, without the synchronized sections, I'm building a non-thread-safe version, right?


--
Paul Bonser
http://blog.paulbonser.com

Paul Bonser

unread,
Aug 9, 2009, 2:56:17 PM8/9/09
to program...@googlegroups.com
Well, it compiled, but now when I run "./mininush tools/nuke install" I get the following:

2009-08-09 13:49:10.961 mininush[29127] unknown type identifier {_NSRange=II}
2009-08-09 13:49:10.962 mininush[29127] unknown type identifier {_NSRange=II}
2009-08-09 13:49:10.962 mininush[29127] UNIMPLEMENTED: can't wrap structure of type {_NSRange=II}
2009-08-09 13:49:10.962 mininush[29127] Terminating due to uncaught exception (below):
2009-08-09 13:49:10.962 mininush[29127] NuUnknownMessage: unable to find message handler for ("" first)

Any suggestions for that? The "UNIMPLEMENTED" makes me worried a bit..

Tim Burks

unread,
Aug 10, 2009, 1:02:24 AM8/10/09
to program...@googlegroups.com
Paul,

Are you building for 64 or 32 bits? The relevant code is near the top
of objc/bridge.m, where we're explicitly setting the type for NSRange.
You probably are compiling this:

#define NSRANGE_SIGNATURE "{_NSRange=QQ}"

when we should instead be compiling this:

#define NSRANGE_SIGNATURE "{_NSRange=II}"

Tim

Paul Bonser

unread,
Aug 10, 2009, 11:55:07 PM8/10/09
to program...@googlegroups.com
On Mon, Aug 10, 2009 at 12:02 AM, Tim Burks <timb...@gmail.com> wrote:

Paul,

Are you building for 64 or 32 bits? The relevant code is near the top
of objc/bridge.m, where we're explicitly setting the type for NSRange.
You probably are compiling this:

#define NSRANGE_SIGNATURE "{_NSRange=QQ}"

when we should instead be compiling this:

#define NSRANGE_SIGNATURE "{_NSRange=II}"

That fixed it. Thanks!
Now I just have to figure out how to use the language.

Jeff Buck

unread,
Aug 22, 2009, 2:46:36 PM8/22/09
to Programming Nu
Hi Paul,

One problem you may have run into is that apt-get currently fetches
GNUstep 1.16. This is an old version. You want GNUstep version
1.18.0, which adds support for @synchronized and will compile Nu
without you having to hack up the source.

For details on getting Nu compiled and running on Linux, including how
to install GNUstep 1.18.0, check out the file notes/DEBIANINSTALL in
the Nu distribution (get it fresh from github, I just updated it last
night). It assumes you are starting out with a fresh Debian Lenny
install, but it probably will also work for Ubuntu.

You can either follow along with DEBIANINSTALL manually, doing just
the steps you need, or run it like this (it's actually a shell
script):
sh ./DEBIANINSTALL

It assumes you are running it from some development root directory
(don't run it from Nu's notes directory!). If you are going to run it
automatically, first check out what it is installing (it assumes a
mostly blank development environment, so it installs things like git-
core, etc.) and the assumptions it makes about directories and such -
you'll probably want to tweak it for your own style.

I've been using it to commission fresh Debian Rackspace cloudservers.
I create a new server, scp the DEBIANINSTALL file to the fresh server,
and run it as above.

You can use just the GNUstep parts of the script to install GNUstep
1.18.0, but make sure you first uninstall GNUstep 1.16 or Nu will
probably link with the older libraries.

Jeff
Reply all
Reply to author
Forward
0 new messages