# samba 4 errors in compiling :-(

## Krog

output of emerge samba: http://pastebin.com/Pa5uzY60

emerge --info '=net-fs/samba-4.2.9::gentoo' http://pastebin.com/NeNybQhx

I tried to search on the forum and follow this or that suggestion (heimdal with -thread and others) but always fails!

please help  :Sad: 

----------

## schorsch_76

```
 * gcc-config: No gcc profile is active!

 * gcc-config: No gcc profile is active!

 * gcc-config: No gcc profile is active!
```

Try to set a gcc profile  :Wink: 

----------

## NeddySeagoon

Krog,

You have --depclean ed your active gcc.

This happens when you upgraded to a newer gcc but didn't select it, so the older one continues to be used.

----------

## Krog

 *Quote:*   

> krogpc krog # gcc-config -l  
> 
>  [1] x86_64-pc-linux-gnu-4.8.5
> 
>  [2] x86_64-pc-linux-gnu-4.9.3 *
> ...

 

to be sure I did a gcc-config 2

let's see... compiling again

----------

## Krog

it says the same! trying the other profile  :Sad: 

----------

## Krog

strange thing, samba searches for /etc/env.d/gcc/config-i686-pc-linux-gnu

but my gcc-config profile is x86_64-pc-linux-gnu-4.9.3

so i have:

```
ls /etc/env.d/gcc/ -l

totale 12

-rw-r--r-- 1 root root  34 10 apr 21.15 config-x86_64-pc-linux-gnu

-rw-r--r-- 1 root root 360 18 feb 10.07 x86_64-pc-linux-gnu-4.8.5

-rw-r--r-- 1 root root 360 18 feb 09.42 x86_64-pc-linux-gnu-4.9.3

```

it says: Checking for program gcc or cc           : x86_64-pc-linux-gnu-gcc 

but then: usr/bin/gcc-config: riga 72: /etc/env.d/gcc/config-i686-pc-linux-gnu: File o directory non esistente

gcc-config: error: could not run/locate 'i686-pc-linux-gnu-cpp'

----------

## NeddySeagoon

Krog,

config-x86_64-pc-linux-gnu contains the name of the currently selected x86_64-pc-linux-gnu compiler.

What does that file contain?

Its just one line of text.

```
gcc-config: error: could not run/locate 'i686-pc-linux-gnu-cpp'
```

That's a 32 bit compiler. It has i686 in its name.

Why is samba looking for that?

Pastebin the entire build log.

----------

## Krog

 *NeddySeagoon wrote:*   

> 
> 
> Why is samba looking for that?
> 
> Pastebin the entire build log.

 

it's not the first pastebin i did?

samba compiled with this:

ABI_X86="64" emerge samba

my make.conf has:

ABI_X86="64 32"

Is this wrong? I tought ABI_X86 is to have 32bit libraries too, but samba should be enough with 64 bit only...

----------

## NeddySeagoon

Krog,

Sorry about missing your pastebin.

The build system will build samba twice, once for each ABI.

At line 55 Checking for program gcc or cc           : ['x86_64-pc-linux-gnu-gcc', '-m32']   Thats getting your 64 bit compiler to emit 32 bit code. 

At line 1240, Checking for program gcc or cc           : x86_64-pc-linux-gnu-gcc   that's for the 64 bit compiler.

At line 2646  /usr/bin/gcc-config: riga 72: /etc/env.d/gcc/config-i686-pc-linux-gnu: File o directory non esistente 

Its trying to select the i686 compiler.

That looks wrong to me but I'm  /no-multilib/ so I don't see these issues myself.

----------

## Krog

I compiled samba 64 bits only but now ffmpeg wants to recompile it with 64 bit...

----------

## allistarM

 *Krog wrote:*   

> I compiled samba 64 bits only but now ffmpeg wants to recompile it with 64 bit...

 

I get the exact same issue. When I try and force ffmpeg to not compile a 32bit binary the issue compounds and further packages start complaining. My fix so far is to mask this version of samba. It seems that samba is using a different compiler or looking in a different place when compiling a 32bit binary than other packages that do the same.

----------

## Krog

i'm too old for this

i have problems with apache now, finally it compiled but other errors launching it

not at home at the moment, I will post the log later

----------

## Saundersx

I have the exact same problem. In my situation though I have a laptop and desktop that are both gentoo, the laptop is a newer install and has no problem compiling the latest samba with exactly the same use flags and almost identical make.conf . The desktop used to have crossdev installed (iirc for audrino-related stuff a looong time ago) so I'm willing to bet there are some bad env files kicking around. 

For me adding "-abi_x86_32" to the packages.use was a quick fix and it compiled right away without, hopefully, any issues.

----------

## Saundersx

Lucky guess on my part, reinstalled crossdev, removed the cruft and samba compiled fine.

```
# crossdev -C avr

 * Uninstalling target 'avr' ...

/usr/avr: directory still exists; remove recursively? [y/N] y

# crossdev -C i686

 * Uninstalling target 'i686-pc-linux-gnu' ...

```

----------

## dr41nU

Hi,

Same problem for me. I had been using crossdev in the past and it seems that I have not removed it properly. Indeed, there was still things in the directory /usr/i686-pc-linux-gnu.

So I installed once again crossdev :

```
emerge -avq1 crossdev
```

Afterwards I removed the old remaining target, paying attention to remove directory /usr/i686-pc-linux-gnu :

```
athlonx4 ~ # crossdev -C i686

 * Uninstalling target 'i686-pc-linux-gnu' ...

<<< cross-i686-pc-linux-gnu/linux-headers-4.0

<<< cross-i686-pc-linux-gnu/glibc-2.20-r2

/usr/i686-pc-linux-gnu: directory still exists; remove recursively? [y/N] y
```

Then, I was able to upgrade samba :

```
emerge -avqu1 samba
```

And finally uninstall crossdev

```
emerge -C crossdev
```

Laurent

----------

## raddaqii

Tremendously helpful advice, Neddy, dr41nU and Saundersx!

Fixing crossdev was what I needed, and it just had not occurred to me despite looking at the build log. Didn't see the wood for the trees, now I do. Thank you all.

----------

