# objective c missing for cross compiler



## kr651129 (Feb 9, 2012)

I'm building a cross compiler and I need to build binutils.  It configures fine but when I run


```
$ make all
```

I get this error


```
........
cc: ../../binutils-2.22/gprof/flat_bl.m: Objective-C compiler not installed on this system
*** Error code 1
........
```

I tried some googling and have found that Objective C is no longer apart of the BSD core but I came across a few things that said clang is the port I need so I did


```
# pkg_add clang -r
```

It installed fine but I'm still getting the Objective C error.

Thoughts?


----------



## SirDice (Feb 9, 2012)

kr651129 said:
			
		

> I'm building a cross compiler and I need to build binutils.



devel/binutils


----------



## kr651129 (Feb 9, 2012)

Thanks SirDice but I already have binutils for my machine installed from ports.  I need to compile another one for my cross compiler and I'm running into this error.


----------



## kr651129 (Feb 9, 2012)

Ahh, sorry.  I opened my mouth too soon.  I should have kept reading.

http://www.freshports.org/devel/cross-binutils

My question is if TGTARCH is my architecture than how do I set the prefix, TGTABI?


----------



## kr651129 (Feb 9, 2012)

I know that I'm a n00b but I'd like to share my results.

Everything compiled with

`# make TGTARCH=i586 TGTABI=elf install clean`

everything seems to be in my /usr/local/cross EXCEPT for the actual compiler, looked under /usr/local/cross/bin and /usr/local/cross/i586-elf.


----------



## kr651129 (Feb 9, 2012)

*building a i586-elf cross compiler*

[ merged in -- Mod. ]

I've been trying to build a gcc cross compiler for i586-elf and I've been running into some problems.  I've installed the devel/cross-binutils and devel/cross-gcc ports but they are not what I'm needing.  When I try to build binutils from source for this I'm getting an error that I don't have an objective c compiler installed.  So I installed one and pointed binutils towards it via *./configure* and it error-ed out.  Before I switched from linux I was screwing around with OS dev and that's what I intend to use this cross compiler for.  Anyone have any suggestions?


----------



## kr651129 (Feb 11, 2012)

Here's the "solution" I had to install Ubuntu via virtualbox.   I then compiled my i586-elf cross compiler inside of that.  I'm going to create a shared folder between *Free*BSD and Ubuntu so I can write my code in *Free*BSD and compile in Ubuntu.  Sounds like a hassle and it kind of is but I'm removing gnome and booting straight into command line so it'll be like an open terminal. That takes 512 MB of RAM and 30 GB of disk space. So unless I can learn how to write a cross compiler for i586-elf on *Free*BSD this seems to be my best option?


----------



## kr651129 (Feb 12, 2012)

I don't really want to have to use VirtualBox for my cross compiler so I'm trying to find out how to accomplish this.  I'm trying to build gcc from source with the following configure


```
$ ./configure --prefix=/home/kclark/krisos/compiler --enable-language=c,c++,java,objc,obj-c++
```

So I can use this to compile my cross compiler that is saying I'm missing objc

Everything configures fine but when I run *make all-gcc* (or *make*/*make all*) I get the following errors.


```
$ make all-gcc
"Makefile", line 26: Missing dependency operator
"Makefile", line 27: Need an operator
"Makefile", line 28: Need an operator
"Makefile", line 779: Missing dependency operator
"Makefile", line 780: Could not find 
"Makefile", line 781: Need an operator
make: fatal errors encountered -- cannot continue
```

Line 26-28:

```
ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty.
$(error GNU make version 3.80 or newer is required.)
endif
```

Line 779-781:

```
ifneq ($(BUILD_CONFIG),)
include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
endif
```


----------



## kr651129 (Feb 13, 2012)

bump

I'm about to give up, I'd really like to figure this out... any suggestions please.


----------



## kr651129 (Feb 13, 2012)

I've fixed everything, going to make a howto and post the solution in the next day or so


----------



## solskogen (Apr 13, 2012)

kr651129 said:
			
		

> I'm building a cross compiler and I need to build binutils.  It configures fine but when I run
> 
> 
> ```
> ...



And that's where your problem is. Use gmake (install it if it's not already installed) instead.


----------

