Giter Club home page Giter Club logo

Comments (6)

tycho avatar tycho commented on August 23, 2024

I'm not sure what you're asking.

You can build a binary for either 32-bit or 64-bit but not both. But a 32-bit binary will run on both i386/x86_64.

$ make CC="gcc -m64"
    * rebuilding cpuid: new build flags or prefix
    CC cache.o
    CC clock.o
    CC cpuid.o
    CC feature.o
    CC handlers.o
    CC main.o
    CC sanity.o
    CC threads.o
    CC util.o
    GEN license.h
    GEN build.h
    CC version.o
    LD cpuid

$ file cpuid
cpuid: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=49c338f2211fca73f84b222ee789177e2e39478a, not stripped

$ make CC="gcc -m32"
    * rebuilding cpuid: new build flags or prefix
    GEN build.h
    DEPEND version.d
    DEPEND util.d
    DEPEND threads.d
    DEPEND sanity.d
    DEPEND main.d
    DEPEND handlers.d
    DEPEND feature.d
    DEPEND cpuid.d
    DEPEND clock.d
    DEPEND cache.d
    GEN build.h
    CC cache.o
    CC clock.o
    CC cpuid.o
    CC feature.o
    CC handlers.o
    CC main.o
    CC sanity.o
    CC threads.o
    CC util.o
    CC version.o
    LD cpuid

$ file cpuid
cpuid: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=db6ccc05d4c51e036e84f64bd345aeb0c13d58fe, not stripped

from cpuid.

onixsosx avatar onixsosx commented on August 23, 2024

Hi!
Thank You for replying :)
x64 built ok but unsuccessful on x32

bash-3.2# make CC="gcc -m32"
* rebuilding cpuid: new build flags or prefix
CC cache.o
CC clock.o
CC cpuid.o
CC feature.o
CC handlers.o
CC main.o
CC sanity.o
CC threads.o
threads.c: In function ‘thread_count_native’:
threads.c:62: warning: unused parameter ‘state’
threads.c: In function ‘thread_bind_mask’:
threads.c:132: warning: unused parameter ‘_mask’
CC util.o
GEN license.h
GEN build.h
CC version.o
LD cpuid
ld: absolute addressing (perhaps -mdynamic-no-pic) used in _create_description from cache.o not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs
collect2: ld returned 1 exit status
make: *** [cpuid] Error 1
bash-3.2#

from cpuid.

onixsosx avatar onixsosx commented on August 23, 2024

to follow up.. I am on Mac OS X

from cpuid.

tycho avatar tycho commented on August 23, 2024

Worth noting that CPUID's behavior won't be predictable on Mac OS X because they do not expose any thread affinity APIs (that's what the compiler warnings in threads.c are about -- those functions aren't actually implemented).

Why is it you're trying to do a 32-bit build on OS X, anyway? There were very few 32-bit Intel Macs released, and I believe they're unsupported these days. Assuming you have the build environment for it you could do something like CC="gcc -arch i386 -mmacosx-version-min=10.6", but I don't know how your build environment is set up.

from cpuid.

onixsosx avatar onixsosx commented on August 23, 2024

I am trying to build for my older Macs which i believe are still x32.
I will continue to experiment on how I could build it in x32 Giving me the info above will surely help. :)

Thank You so much tycho

from cpuid.

tycho avatar tycho commented on August 23, 2024

Please note that "x32" is something entirely different -- the term you are looking for is "x86-32" or just "x86".

Let me know if you succeed.

from cpuid.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.