Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2nd December 2006, 01:29 PM
eschi Offline
Registered User
 
Join Date: Apr 2006
Posts: 79
build a 32 bit driver under 64

Hi.
My host system is Fedora Core 6 (64 bit).

I am running a 32 bit application which needs a 32 bit chipcard driver. For the driver I have all the sources. My problem is, when I make a "configure->make->make install" I obviously get a 64 bit driver.

Can somebody explain me the way, how to build a 32 bit driver under a running 64 bit linux system?

Thank you in advance,
Dirk
Reply With Quote
  #2  
Old 2nd December 2006, 03:03 PM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
./configure --help

see if this offers any options
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5
Reply With Quote
  #3  
Old 2nd December 2006, 03:20 PM
eschi Offline
Registered User
 
Join Date: Apr 2006
Posts: 79
Thank you for that.

Are the flags "--build=" and "--host=" the right ones? But what do I have to insert there? "i386" ???

I will post the output:

Code:
Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local/towitoko]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/towitoko/bin', `/usr/local/towitoko/lib' etc.  You can specify
an installation prefix other than `/usr/local/towitoko' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --infodir=DIR          info documentation [PREFIX/info]
  --mandir=DIR           man documentation [PREFIX/man]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-card-type(=sync|async)
                          card type (default=probe)
  --enable-card-convention(=dir|inv)
                          card convention (default=probe)
  --enable-memory-type(=i2cs|i2cl|2w|3w)
                          memory card type (default=probe)
  --enable-memory-size(=size)
                          memory card size (default=probe)
  --enable-ISO-t0         transportation of APDUs by T=0 (default=no)
  --enable-debug(=1|2|3|4)
                          enable debug (default=no)
  --enable-usb-bundle     enable PCSC Lite USB bundle installation
                          (default=no)
  --enable-devfs          enable Linux 2.4.X devfs support (default=no)
  --enable-devpcsc        enable /dev/pcsc links support (default=no)
  --enable-win32-com      enable win32 style COM port numbering (default=no)
  --enable-thread-mutex   enable thread mutexes (default=yes)
  --enable-atr-check      enable checking of valid ATR (default=yes)
  --enable-atr-timings    enable decoding of timings from ATR (default=yes)
  --disable-dependency-tracking Speeds up one-time builds
  --enable-dependency-tracking  Do not reject slow dependency extractors
  --enable-static=PKGS  build static libraries default=no
  --enable-shared=PKGS  build shared libraries default=yes
  --enable-fast-install=PKGS  optimize for fast installation default=yes
  --disable-libtool-lock  avoid locking (might break parallel builds)

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pcsc-lite-dir    PCSC Lite base directory (default=/usr/local/pcsc)
  --with-gnu-ld           assume the C compiler uses GNU ld default=no
  --with-pic              try to use only PIC/non-PIC objects default=use both

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
              headers in a nonstandard directory <include dir>
  CPP         C preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Reply With Quote
  #4  
Old 2nd December 2006, 04:00 PM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
try

./configure --build=i686
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5
Reply With Quote
  #5  
Old 2nd December 2006, 04:16 PM
eschi Offline
Registered User
 
Join Date: Apr 2006
Posts: 79
I tried that already.

It builds something, but when I try to test it (with an application which is also builded out of the chipcard sources) the test program gets an error. Without the build=i686 flag, the builded test program works fine with the builded chipcard driver.

Dirk
Reply With Quote
  #6  
Old 2nd December 2006, 07:32 PM
Noneus Offline
Registered User
 
Join Date: May 2006
Posts: 47
Is it possible to load a 32bit kernel module in a 64bit kernel? I would say no. Did you try to compile the 64bit module load it and test the software? I guess it should work. 32bit nvidia libs work with 64bit nvidia module too.
Reply With Quote
  #7  
Old 2nd December 2006, 08:12 PM
BillT440 Offline
Registered User
 
Join Date: Oct 2006
Location: New Jersey
Posts: 106
I'm giong to have to back up Noneus. As far as I know, there is no way to load a 32bit module into a 64bit kernel or vice versa.
Reply With Quote
  #8  
Old 2nd December 2006, 08:15 PM
eschi Offline
Registered User
 
Join Date: Apr 2006
Posts: 79
As far as I know, it's not possible to load a 32 bit module in the kernel. But what I would like to have, is to load a library in a 32 bit application. And because I compiled the library by myself, it's a 64 bit library. And that definitly doesn't work. The application doesn't understand the 64 bit driver. It says, that it's not a valid library.
Reply With Quote
  #9  
Old 2nd December 2006, 10:13 PM
Noneus Offline
Registered User
 
Join Date: May 2006
Posts: 47
You need special compile flags. Try these:
-march=i386 -m32

You need to tell the linker that it should create a 32bit binary
--format elf32-i686 -m elf_i386
Reply With Quote
  #10  
Old 4th December 2006, 05:22 PM
eschi Offline
Registered User
 
Join Date: Apr 2006
Posts: 79
Thank you Noneus.

But I don't know how to tell the configure script the flags.
Reply With Quote
  #11  
Old 4th December 2006, 05:50 PM
Noneus Offline
Registered User
 
Join Date: May 2006
Posts: 47
Code:
export LDFLAGS="--format elf32-i686 -m elf_i386"
export CFLAGS="-march=i386 -m32"
export CXXFLAGS=$CFLAGS
./configure --your-configure-flags
If you don't have a configure script just use this for make:
make CFLAGS="-march=i386 -m32" CXXFLAGS="-march=i386 -m32" LDFLAGS="--format elf32-i686 -m elf_i386"

This should work.
Reply With Quote
  #12  
Old 4th December 2006, 06:17 PM
eschi Offline
Registered User
 
Join Date: Apr 2006
Posts: 79
I get the following error after running the configure script:

Code:
[me@localhost towitoko-2.0.7]# ./configure --build=i686
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking build system type... i686-pc-none
checking host system type... i686-pc-none
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
Reply With Quote
  #13  
Old 5th December 2006, 07:47 PM
eschi Offline
Registered User
 
Join Date: Apr 2006
Posts: 79
Hi.

I just want to let you know, that I built the library in a virtual machine with Fedora Core 5 i386.
And it works.

Thank you Noneus, for your help.
Reply With Quote
Reply

Tags
bit, build, driver

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to build the driver for NIC on FC6. rajat123 Hardware & Laptops 4 19th April 2007 12:43 PM
driver build error Zero-Override Servers & Networking 11 26th November 2006 12:36 AM


Current GMT-time: 05:14 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat