# Building for Intel on AMD in a chroot?

## TheLazy1

Hi.

I was looking to speed up the install process for my Atom based netbook so I thought that emerging most packages in a chroot 

on my desktop would speed things up a lot and save tons of time.

This worked, sort of until I hit firefox where the build fails with an illegal instruction which I realize now makes total sense.

I know that the problem lies with -march=atom since changing it to i686 works.

Oddly enough so far firefox is the only package which failed to build, I assume it's running something it built and hitting some instruction that is not available on my Phenom II.

I could build everything as a generic i686, but I figure that if I'm going to be building everything from scratch I might as well use the correct arch.

Any thoughts?

I'd honestly rather not compile anything big on a netbook at all  :Razz: 

----------

## Veldrin

what are you trying to build? 32-bit or 64-bit? (it seems, that atom is a 64-bit march).

depending on that answer, I would go either with pentium-m on 32-bit or x86_64 (i.e no march) on 64-bit. This provides you with the maximum specialization without causing a break due to the difference between AMD and Intel archs. 

Optionally you can add -msse3 to enable SSE3 (pni on the cpu).

the bugger in you case is SSSE3 [sic], which is only available on Intel systems, and it is only useful for multimedia (and other vector based) applications. 

If you want to get closer, you need a recent Intel CPU on the build host.

V.

----------

## TheLazy1

I started from the 32bit stage3 tarball since the cpu in my netbook iirc is 32bit only.

What I read though, unless I misunderstood was that -march=atom has better optimizations since the atom is in-order execution only.

Though, I can see if that wouldn't make much of a difference.

Unless I use distcc for some packages maybe?

Everything else so far rebuilt with new cflags up to Xorg and xfce have emerged just fine, but I'd hate to find out hours later when (x) package hit an sse3 instruction.

----------

## krinn

if you are just certain ssse3 is bugging you, you can simply disable it, most gcc switch have a -mno-switchname option.

-march=atom -mno-ssse3

----------

## TheLazy1

I'm pretty sure that's it, I'm going to try disabling ssse3 for firefox and see if it finishes building.

If it does, then I guess some packages will have to be built with -mno-ssse3 which kinda stinks because it seems like it would've made use of it.

----------

## Ion Silverbolt

Are you chrooting from a 64-bit environment into a 32-bit one? Or does your Atom support 64-bit? I know the Atom 280n and older only support 32-bit.

Also, did you put linux32 in front of chroot if/when you chrooted into your 32-bit chroot?

----------

## TheLazy1

Yes, I always remember  :Smile: 

Firefox built fine if I did this:

```

CFLAGS="-march=i686  -mtune=generic -fomit-frame-pointer -pipe" CXXFLAGS=$CFLAGS emerge -av firefox

```

It's a bit hacky but at least it didn't fail.

----------

## Ion Silverbolt

I used my Phenom 2 to build a core2 system. Everything worked that was compiled. 

Very few packages even use ssse3. I doubt FF does at all. It seems to me that whenever I had problems compiling FF in the past, it was because it didn't like makeopts set too high. 

Also, I'm not sure the arch matters so much while compiling. It's the cpu trying to run it at the other end that will determine pass/fail.  I could be wrong though. Where is a gcc developer when you need one.  :Smile: 

----------

