Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GNUstep install on FreeBSD9.1

20 views
Skip to first unread message

Steven LeMaire

unread,
Apr 1, 2013, 8:28:09 PM4/1/13
to discuss...@gnu.org
Hi Everyone,

I've started to play around with FreeBSD and everything is going well on that side.
I installed v9.0, which I upgraded to v9.1 using the (I guess) standard upgrade process. Very nice and easy.

Now I'm trying to get GNUstep installed using the ports method. I altered /etc/make.conf in order to use clang as the compiler:

/etc/make.conf
--------------------
GNUSTEP_WITH_CLANG=yes
WITH_GNUSTEP_DEVEL=yes
GNUSTEP_WITH_LIBOBJC2=yes
CC=clang
CXX=clang++

Unfortunately, running "make install clean" in /usr/ports/devel/gnustep fails with this:

configure: exit 1
(end of "config.log")
*** [do-configure] Error code 1

Stop in /usr/ports/lang/gnustep-base.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/gnustep.

Scrolling up in the output, the first problem encountered is this:
....
Checking whether objc really works... no
I don't seem to be able to use your Objective-C compiler to produce
working binaries! Please check your Objective-C compiler installation.
If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
can be found by the dynamic linker - usually that requires you to play
with LD_LIBRARY_PATH or /etc/ld.so.conf.
Please refer to your compiler installation instructions for more help.
configure: error: The Objective-C compiler does not work or is not installed properly.

I'm not sure how to fix this in clang (I assume clang needs updating ?)

clang -v tells me this:

# clang -v
FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
Target: i386-unknown-freebsd9.0
Thread model: posix

Strange that clang reports freebsd9.0, but it's actually 9.1

# uname -a
FreeBSD maple 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec 4 06:55:39 UTC 2012 ro...@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386

Any help would be appreciated !

Many thanks
Steven


Riccardo Mottola

unread,
Apr 2, 2013, 3:20:43 AM4/2/13
to discuss...@gnu.org
Hi,

On 04/02/13 02:28, Steven LeMaire wrote:
> I'm not sure how to fix this in clang (I assume clang needs updating ?)
>
> clang -v tells me this:
>
> # clang -v
> FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
> Target: i386-unknown-freebsd9.0
> Thread model: posix
>
> Strange that clang reports freebsd9.0, but it's actually 9.1
>
> # uname -a
> FreeBSD maple 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec 4 06:55:39 UTC 2012 ro...@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>
> Any help would be appreciated !
I have seen this thread on the freebsd forums too.

My personal experience is that in FreeBSD 9.x, the two system standard
compilers gcc 4.2 (because it was explicitly removed, since in FreeBSD
it worked fined) and clang (perhaps because it is old, I don't know) are
incapable of building gnustep.

Your options thus are to install a better gcc or clang from ports. On
all other systems I follow the first one, but since FreeBSD is going the
clang route, it is the one I followed.

Together with clang, you need gnustep-libobjc2.

I use sources, not ports, but I guess the requisites are similar. When I
configure, I explicitly point CC to be /usr/local/bin/clang instead of
"clang" else, the system one gets used.

E.g. (writing from memory) ./configure CC=/usr/local/bin/clang


How this can be applied to ports, I don't know. Also, if it can be
proven that the system compiler is not enough and a ports compiler needs
to be used, it is a ports bug which should check for the compiler
version and in case use the correct one.

Riccardo

David Chisnall

unread,
Apr 2, 2013, 10:51:45 AM4/2/13
to Riccardo Mottola, discuss...@gnu.org
On 2 Apr 2013, at 08:20, Riccardo Mottola <riccardo...@libero.it> wrote:

> My personal experience is that in FreeBSD 9.x, the two system standard compilers gcc 4.2 (because it was explicitly removed, since in FreeBSD it worked fined) and clang (perhaps because it is old, I don't know) are incapable of building gnustep.

This may have been true in 9.0 (although I don't believe it was), however it is definitely not true of 9.1.

David


Citizen Jimserac

unread,
Apr 4, 2013, 9:09:55 AM4/4/13
to
On Apr 1, 8:28 pm, Steven LeMaire <photo...@gmail.com> wrote:
> Hi Everyone,
>
> I've started to play around with FreeBSD and everything is going well on that side.
> I installed v9.0, which I upgraded to v9.1 using the (I guess) standard upgrade process. Very nice and easy.
>
> Now I'm trying to get GNUstep installed using the ports method. I altered /etc/make.conf in order to use clang as the compiler:
>

On PC-BSD 9.1
I just typed
portinstall gnustep
from a root terminal but you obviously want to do more.

Unfortunately, 9.1 STILL does not support ANY of my USB wireless
devices and so out it went. Too bad, clearly a superiour
distribution, they could have owned the Linux world if only they had
developed the drivers ....

J.

David Chisnall

unread,
Apr 4, 2013, 9:20:01 AM4/4/13
to Citizen Jimserac, discuss...@gnu.org
On 4 Apr 2013, at 14:09, Citizen Jimserac <jims...@gmail.com> wrote:

> Unfortunately, 9.1 STILL does not support ANY of my USB wireless
> devices

What wireless device do you have? Atheros and ralink generally have good FreeBSD support. It's been a while since I came across a wireless interface without FreeBSD support.

David


Citizen Jimserac

unread,
Apr 4, 2013, 9:32:16 AM4/4/13
to
On Apr 4, 9:20 am, David Chisnall <David.Chisn...@cl.cam.ac.uk> wrote:
> On 4 Apr 2013, at 14:09, Citizen Jimserac <jimse...@gmail.com> wrote:
>
> > Unfortunately, 9.1 STILL does not support ANY of my USB wireless
> > devices
>
> What wireless device do you have?  Atheros and ralink generally have good FreeBSD support.  It's been a while since I came across a wireless interface without FreeBSD support.
>
> David

NETGEAR WNA1100 Wireless USB Adapter
(uses an Atheros chip I think).

Steven LeMaire

unread,
Apr 4, 2013, 8:25:30 PM4/4/13
to Citizen Jimserac, discuss...@gnu.org
Lucky you. I don't really want to do more, just trying stuff out.
I've tried building from the sources also, I'm getting the same error -

"checking whether objc really works... no
I don't seem to be able to use your Objective-C compiler to produce
working binaries! Please check your Objective-C compiler installation.
If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
can be found by the dynamic linker - usually that requires you to play
with LD_LIBRARY_PATH or /etc/ld.so.conf.
Please refer to your compiler installation instructions for more help.
configure: error: The Objective-C compiler does not work or is not installed properly."

I upgraded clang to v 3.2 and tried going back to using gcc 4.2 (installed with freebsd).
No joy.

I have a feeling now it might be in the configure script ?
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss...@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep


David Chisnall

unread,
Apr 5, 2013, 3:18:28 AM4/5/13
to Steven LeMaire, Citizen Jimserac, discuss...@gnu.org
On 5 Apr 2013, at 01:25, Steven LeMaire <phot...@gmail.com> wrote:

> configure: error: The Objective-C compiler does not work or is not installed properly."

Please can you post the relevant part of the config.log file, telling us what the error message was and what actually failed?

David


-- Send from my Jacquard Loom


Riccardo Mottola

unread,
Apr 5, 2013, 3:41:31 AM4/5/13
to discuss...@gnu.org
On 04/05/13 02:25, Steven LeMaire wrote:
> Lucky you. I don't really want to do more, just trying stuff out.
> I've tried building from the sources also, I'm getting the same error -
>
<snip>
>
> I upgraded clang to v 3.2 and tried going back to using gcc 4.2 (installed with freebsd).
> No joy.
>
> I have a feeling now it might be in the configure script ?
>
As explained, the system gcc 4.2 *will not work*, after FreeBSD 8.1
obj-c support was removed from the default compiler. If you want to try
your luck with GCC instead of clang, you still need to install the GCC
from ports!

Riccardo

Steven LeMaire

unread,
Apr 6, 2013, 8:39:31 PM4/6/13
to David Chisnall, Citizen Jimserac, discuss...@gnu.org
Hi David,

I think I've narrowed it down in the config log:

configure:12794: checking whether objc really works
configure:12824: clang -o conftest -O2 -pipe -I/usr/local/include/libxml2/libxml -DHAVE_DLADDR=1 -I/usr/local/include -DOBJC2RUNTIME=1 -fno-strict-aliasi
ng -I/usr/local/GNUstep/System/Library/Headers -I/usr/local/GNUstep/Local/Library/Headers -I/usr/local/GNUstep/Local/Library/Headers -I/usr/local/includ
e -fgnu-runtime -x objective-c -L/usr/local/GNUstep/System/Library/Libraries -L/usr/local/GNUstep/Local/Library/Libraries -L/usr/local/GNUstep/Local/Li
brary/Libraries -L/usr/local/lib conftest.c -lrt -lpthread -rdynamic -L/usr/local/lib -pthread -fgnu-runtime -L/root/GNUstep/Library/Libraries -L/usr/lo
cal/GNUstep/Local/Library/Libraries -L/usr/local/GNUstep/System/Library/Libraries -L/usr/local/lib -l:libobjc.so.16 -lm >&5
In file included from conftest.c:97:
In file included from ././config/config.objc.m:2:
././config/objc-common.g:46:8: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecate
d-objc-isa-usage]
obj->isa = self;
^
././config/objc-common.g:39:5: note: instance variable is declared here
id isa;
^
././config/objc-common.g:37:12: warning: class 'NSObject' defined without specifying a base class [-Wobjc-root-class]
@interface NSObject
^
././config/objc-common.g:37:20: note: add a super class to fix this problem
@interface NSObject
^
: NSObject
In file included from conftest.c:97:
././config/config.objc.m:4:12: warning: class 'Test' defined without specifying a base class [-Wobjc-root-class]
@interface Test
^
././config/config.objc.m:4:16: note: add a super class to fix this problem
@interface Test
^
: NSObject
3 warnings generated.
/usr/bin/ld: conftest: hidden symbol `__i686.get_pc_thunk.bx' in /usr/lib/libgcc.a(umodsi3.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-------------------

I've tried manually compiling & linking a bare bones objc program, and I get the same results at link time.
This is with clang v 3.2, I have libobjc2 installed and I added these options to /etc/make.conf

GNUSTEP_WITH_CLANG=yes
USE_GNUSTEP_CONFIGURE=yes
ADDITIONAL_CFLAGS +=-I/usr/local/include
ADDITIONAL_LDFLAGS +=-L/usr/local/lib -lobjc
CC=clang
CXX=clang++

The linking with /usr/lib/libgcc.a seems to be a default ? Is it really needed or can it be turned off with some linker switch ? (I haven't found any).

Cheers
Steven



On 2013-04-05, at 3:18 AM, David Chisnall wrote:

> On 5 Apr 2013, at 01:25, Steven LeMaire <phot...@gmail.com> wrote:
>
>> configure: error: The Objective-C compiler does not work or is not installed properly."
>

David Chisnall

unread,
Apr 7, 2013, 6:00:46 AM4/7/13
to Steven LeMaire, discuss...@gnu.org, Citizen Jimserac
On 7 Apr 2013, at 01:39, Steven LeMaire <phot...@gmail.com> wrote:

> /usr/bin/ld: conftest: hidden symbol `__i686.get_pc_thunk.bx' in /usr/lib/libgcc.a(umodsi3.o) is referenced by DSO

Are you using an old version of libobjc2? This used to be referenced explicitly, but recent versions of libgcc made it a hidden symbol (breaking the ABI) and so it is now referenced indirectly. If you're using a new binutils, you'll have to use trunk libobjc2.

David


Steven LeMaire

unread,
Apr 7, 2013, 10:22:27 PM4/7/13
to David Chisnall, discuss...@gnu.org, Citizen Jimserac
I'm using the libobjc2 from ports. The distinfo file says its libobjc2-1.6.tar.bz2 Is this not correct ? Do i need to fetch one from svn somewhere ?
I believe my binutils is the stock one from freebsd 9.1, for example ld -v says its GNU ld (GNU Binutils) 2.22

Many thanks for your help
Steven

David Chisnall

unread,
Apr 8, 2013, 4:04:28 AM4/8/13
to Steven LeMaire, Citizen Jimserac, discuss-gnustep@gnu.org Discuss
On 8 Apr 2013, at 03:22, Steven LeMaire <phot...@gmail.com> wrote:

> I'm using the libobjc2 from ports. The distinfo file says its libobjc2-1.6.tar.bz2 Is this not correct ? Do i need to fetch one from svn somewhere ?

Yes, the one from svn is a better bet. I am still chasing some MIPS bugs in either clang, rtld, or our processor, but once that's done I hope to cut the 1.7 release.

> I believe my binutils is the stock one from freebsd 9.1, for example ld -v says its GNU ld (GNU Binutils) 2.22

FreeBSD 9.1 ships with binutils 2.17. You've installed a newer one from ports, which conflicts with this.

David

-- Sent from my Cray X1


Steven LeMaire

unread,
Apr 9, 2013, 10:24:04 PM4/9/13
to David Chisnall, Citizen Jimserac, discuss-gnustep@gnu.org Discuss

I have installed libobjc2 from svn and reinstalled the gnustep-make port so far.

My test program compiles and links properly now so things are looking good. I should get to trying the gnustep port tomorrow.

Cheers
Steven

Steven LeMaire

unread,
Apr 10, 2013, 10:09:30 PM4/10/13
to David Chisnall, Citizen Jimserac, discuss-gnustep@gnu.org Discuss
Well, I really wanted to figure out where the problem with the port is, but unfortunately didn't find it.
I was still getting the error from configure that it couldn't properly compile an objective c program.

I did get GNUstep installed following the instructions linked below. Also, this was using binutils 2.22

0 new messages