Compiling from source... platform specific?

Discussion in 'Linux, BSD and Other OS's' started by zeus, May 31, 2008.

  1. zeus

    zeus out of date

    Likes Received:
    0
    Trophy Points:
    36
    If I compile a package from source does it matter if I have an x86 or powerpc computer? Most binaries are for x86 and I have an ibook with gutsy.

    cheers guys!
     
  2. donkey42

    donkey42 plank

    Likes Received:
    9
    Trophy Points:
    38
    no, if you compiling from source, compiling from source creates the appropriate installation files for the architecture you are compiling it for

    BTW: i can't believe i'm advising about compiling source, anyone would think i compile source all the time, tbh, i haven't even configured HWF kernel in my system let alone compiling from suorce

    Edit: source code is source code it must be compiled before it can be executed on any specific architecture / platform

    e.g. x86, PPC or whatever
     
  3. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    For best results, put CPU-specific Cflags in your /etc/environment file.

    Safe Cflags - Gentoo Linux Wiki

    For instance, to get the best stable Cflags for a G5 SPARC...
    Code:
    CHOST="powerpc64-unknown-linux-gnu"
    CFLAGS="-mcpu=G5 -O2 -pipe -maltivec -mabi=altivec -fno-strict-aliasing"
    CXXFLAGS="${CFLAGS}"
    LDFLAGS="-Wl,-O1"
    
     
  4. donkey42

    donkey42 plank

    Likes Received:
    9
    Trophy Points:
    38
    if i may be so bold
    if source is already compiled for x86 they are not compatible with PPC or any other architecture
     
  5. Addis

    Addis The King

    Likes Received:
    91
    Trophy Points:
    48
    Not all applications can be compiled for any architecture though. There may be cases where certain programs/libraries can only be built for certain architectures, since there's no guarantee that it's portable.
     
  6. donkey42

    donkey42 plank

    Likes Received:
    9
    Trophy Points:
    38
    thankies, are there any tell tale signs to signify a prog/lib source is not cross compilable between arch ?

    Edit: sorry for the stupid post, presumably you can tell the arch by reading the source
     

Share This Page