LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2009, 11:25 AM   #1
smkururu
LQ Newbie
 
Registered: May 2009
Location: /dev/null
Distribution: Ubuntu Jaunty
Posts: 11

Rep: Reputation: 0
make (compile program) 32 bit in 64 bit


Hi, I need to compile 32 bit program (bash it is) in my Ubuntu Jaunty 64 bit, but everytime I compile it, it produce 64 bit executable. Here is how I tried it:
Code:
evans@evans-pc:~/bash-4.0$ linux32 ./configure > configure.log
evans@evans-pc:~/bash-4.0$ linux32 make
/bin/sh ./support/mkversion.sh -b -S . -s release -d 4.0 -o newversion.h \
		&& mv newversion.h version.h
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"i686"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"i686-pc-linux-gnu"' -DCONF_VENDOR='"pc"' -DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g  -DBUILDTOOL -c -o buildversion.o ./version.c
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"i686"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"i686-pc-linux-gnu"' -DCONF_VENDOR='"pc"' -DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g  -o bashversion ./support/bashversion.c buildversion.o 

	  ***********************************************************
	  *                                                         *
	  * GNU bash, version 4.0.0(4)-release (i686-pc-linux-gnu)
	  *                                                         *
	  ***********************************************************

rm -f version.o
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"i686"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"i686-pc-linux-gnu"' -DCONF_VENDOR='"pc"' -DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g -O2 -c version.c
make[1]: Entering directory `/home/evans/.local/share/Trash/files/bash-4.10.0/builtins'
make[1]: `libbuiltins.a' is up to date.
make[1]: Leaving directory `/home/evans/.local/share/Trash/files/bash-4.10.0/builtins'
rm -f bash
gcc -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh  -rdynamic  -g -O2 -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o  dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o bashline.o  list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o  -lbuiltins -lsh -lreadline -lhistory -ltermcap -lglob -ltilde -lmalloc   -ldl 
ls -l bash
-rwxr-xr-x 1 evans evans 3002545 2009-05-20 23:07 bash
size bash
   text	   data	    bss	    dec	    hex	filename
 879638	  35708	  22864	 938210	  e50e2	bash
evans@evans-pc:~/bash-4.0$ file ./bash
./bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
evans@evans-pc:~/bash-4.0$
Here is configure.log:
Code:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for emacs... no
checking for xemacs... no

Beginning configuration for bash-4.0-release for i686-pc-linux-gnu

checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for strerror in -lcposix... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether gcc needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for ar... ar
checking for ranlib... ranlib
checking for bison... no
checking for byacc... no
checking whether make sets $(MAKE)... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for preprocessor stringizing operator... yes
checking for long double with more range or precision than double... yes
checking for function prototypes... yes
checking whether char is unsigned... no
checking for working volatile... yes
checking for C/C++ restrict keyword... __restrict
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for off_t... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether we are using the GNU C Library 2.1 or newer... yes
checking whether integer division by zero raises SIGFPE... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unsigned long long... yes
checking for inttypes.h... yes
checking whether the inttypes.h PRIxNN macros are broken... no
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking argz.h usability... yes
checking argz.h presence... yes
checking for argz.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking nl_types.h usability... yes
checking nl_types.h presence... yes
checking for nl_types.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for feof_unlocked... yes
checking for fgets_unlocked... yes
checking for getc_unlocked... yes
checking for getcwd... yes
checking for getegid... yes
checking for geteuid... yes
checking for getgid... yes
checking for getuid... yes
checking for mempcpy... yes
checking for munmap... yes
checking for putenv... yes
checking for setenv... yes
checking for setlocale... yes
checking for localeconv... yes
checking for stpcpy... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strtoul... yes
checking for tsearch... yes
checking for __argz_count... yes
checking for __argz_stringify... yes
checking for __argz_next... yes
checking for __fsetlocking... yes
checking for iconv... yes
checking for iconv declaration... 
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for nl_langinfo and CODESET... yes
checking for LC_MESSAGES... yes
checking for bison... no
checking whether NLS is requested... yes
checking whether included gettext is requested... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking whether time.h and sys/time.h may both be included... yes
checking for inttypes.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking varargs.h usability... no
checking varargs.h presence... no
checking for varargs.h... no
checking for limits.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking for locale.h... (cached) yes
checking termcap.h usability... yes
checking termcap.h presence... yes
checking for termcap.h... yes
checking termio.h usability... yes
checking termio.h presence... yes
checking for termio.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for stddef.h... (cached) yes
checking for stdint.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking for strings.h... (cached) yes
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking sys/pte.h usability... no
checking sys/pte.h presence... no
checking for sys/pte.h... no
checking sys/stream.h usability... no
checking sys/stream.h presence... no
checking for sys/stream.h... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking for sys/param.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for sys/stat.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for sys/types.h... (cached) yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking for sys/ptem.h... no
checking for working alloca.h... (cached) yes
checking for alloca... (cached) yes
checking whether getpgrp requires zero arguments... yes
checking for vprintf... yes
checking for _doprnt... no
checking for working strcoll... yes
checking return type of signal handlers... void
checking for __setostype... no
checking for wait3... yes
checking for isinf... yes
checking for isnan... yes
checking for mkfifo... yes
checking for dup2... yes
checking for eaccess... yes
checking for fcntl... yes
checking for getdtablesize... yes
checking for getgroups... yes
checking for gethostname... yes
checking for getpagesize... (cached) yes
checking for getpeername... yes
checking for getrlimit... yes
checking for getrusage... yes
checking for gettimeofday... yes
checking for kill... yes
checking for killpg... yes
checking for lstat... yes
checking for readlink... yes
checking for sbrk... yes
checking for select... yes
checking for setdtablesize... no
checking for setitimer... yes
checking for tcgetpgrp... yes
checking for uname... yes
checking for ulimit... yes
checking for waitpid... yes
checking for rename... yes
checking for bcopy... yes
checking for bzero... yes
checking for confstr... yes
checking for fnmatch... yes
checking for getaddrinfo... yes
checking for gethostbyname... yes
checking for getservbyname... yes
checking for getservent... yes
checking for inet_aton... yes
checking for memmove... yes
checking for pathconf... yes
checking for putenv... (cached) yes
checking for raise... yes
checking for regcomp... yes
checking for regexec... yes
checking for setenv... (cached) yes
checking for setlinebuf... yes
checking for setlocale... (cached) yes
checking for setvbuf... yes
checking for siginterrupt... yes
checking for strchr... yes
checking for sysconf... yes
checking for tcgetattr... yes
checking for times... yes
checking for ttyname... yes
checking for tzset... yes
checking for unsetenv... yes
checking for vsnprintf... yes
checking for snprintf... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for isascii... yes
checking for isblank... yes
checking for isgraph... yes
checking for isprint... yes
checking for isspace... yes
checking for isxdigit... yes
checking for getpwent... yes
checking for getpwnam... yes
checking for getpwuid... yes
checking for getcwd... (cached) yes
checking for memset... yes
checking for strcasecmp... (cached) yes
checking for strerror... yes
checking for strftime... yes
checking for strnlen... yes
checking for strpbrk... yes
checking for strstr... yes
checking for strtod... yes
checking for strtol... yes
checking for strtoul... (cached) yes
checking for strtoll... yes
checking for strtoull... yes
checking for strtoimax... yes
checking for strtoumax... yes
checking for fdprintf... no
checking whether confstr is declared... yes
checking whether printf is declared... yes
checking whether sbrk is declared... yes
checking whether setregid is declared... yes
checking whether strcpy is declared... yes
checking whether strsignal is declared... yes
checking whether strtold is declared... yes
checking for broken strtold... no
checking for declaration of strtoimax... yes
checking for declaration of strtol... yes
checking for declaration of strtoll... yes
checking for declaration of strtoul... yes
checking for declaration of strtoull... yes
checking for declaration of strtoumax... yes
checking for sys/time.h... (cached) yes
checking for unistd.h... (cached) yes
checking for alarm... yes
checking for fpurge... no
checking for __fpurge... yes
checking for working mktime... yes
checking for argz.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for malloc.h... (cached) yes
checking stdio_ext.h usability... yes
checking stdio_ext.h presence... yes
checking for stdio_ext.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... (cached) yes
checking for working mmap... (cached) yes
checking for __argz_count... (cached) yes
checking for __argz_next... (cached) yes
checking for __argz_stringify... (cached) yes
checking for dcgettext... yes
checking for mempcpy... (cached) yes
checking for munmap... (cached) yes
checking for stpcpy... (cached) yes
checking for strcspn... yes
checking for strdup... (cached) yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for mbrlen... yes
checking for mbscmp... no
checking for mbsrtowcs... yes
checking for wcrtomb... yes
checking for wcscoll... yes
checking for wcsdup... yes
checking for wcwidth... yes
checking for wctype... yes
checking whether mbrtowc and mbstate_t are properly declared... yes
checking for iswlower... yes
checking for iswupper... yes
checking for towlower... yes
checking for towupper... yes
checking for iswctype... yes
checking for nl_langinfo and CODESET... yes
checking for wchar_t in wchar.h... yes
checking for wctype_t in wctype.h... yes
checking for wint_t in wctype.h... yes
checking for dlopen in -ldl... yes
checking for dlopen... yes
checking for dlclose... yes
checking for dlsym... yes
checking whether sys_siglist is declared... yes
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking for off_t... (cached) yes
checking for mode_t... yes
checking for uid_t in sys/types.h... (cached) yes
checking for pid_t... yes
checking for size_t... (cached) yes
checking for ssize_t... yes
checking for time_t... yes
checking for long long... long long
checking for unsigned long long... unsigned long long
checking return type of signal handlers... (cached) void
checking for sig_atomic_t in signal.h... yes
checking size of char... 1
checking size of short... 2
checking size of int... 4
checking size of long... 8
checking size of char *... 8
checking size of double... 8
checking size of long long... 8
checking for u_int... yes
checking for u_long... yes
checking for bits16_t... no
checking for u_bits16_t... no
checking for bits32_t... no
checking for u_bits32_t... no
checking for bits64_t... no
checking for ptrdiff_t... yes
checking whether stat file-mode macros are broken... no
checking whether #! works in shell scripts... yes
checking whether the ctype macros accept non-ascii characters... no
checking if dup2 fails to clear the close-on-exec flag... no
checking whether pgrps need synchronization... no
checking for type of signal functions... posix
checking for sys_errlist and sys_nerr... yes
checking for sys_siglist in system C library... yes
checking for _sys_siglist in signal.h or unistd.h... yes
checking for _sys_siglist in system C library... yes
checking whether signal handlers are of type void... yes
checking for clock_t... yes
checking for sigset_t... yes
checking for quad_t... yes
checking for intmax_t... yes
checking for uintmax_t... yes
checking for socklen_t... yes
checking for size and type of struct rlimit fields... rlim_t
checking for struct termios.c_line... yes
checking for struct termio.c_line... yes
checking for struct dirent.d_ino... yes
checking for struct dirent.d_fileno... yes
checking for struct dirent.d_namlen... no
checking for struct winsize in sys/ioctl.h and termios.h... sys/ioctl.h
checking for struct timeval in sys/time.h and time.h... yes
checking for struct stat.st_blocks... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for struct timezone in sys/time.h and time.h... yes
checking for the existence of strsignal... yes
checking if opendir() opens non-directories... no
checking whether ulimit can substitute for getdtablesize... yes
checking whether fpurge is declared... no
checking to see if getenv can be redefined... yes
checking if getcwd() will dynamically allocate memory with 0 size... yes
checking for presence of POSIX-style sigsetjmp/siglongjmp... present
checking whether or not strcoll and strcmp differ... no
checking for standard-conformant putenv declaration... yes
checking for standard-conformant unsetenv declaration... yes
checking for printf floating point output in hex notation... yes
checking if signal handlers must be reinstalled when invoked... no
checking for presence of necessary job control definitions... present
checking for presence of named pipes... present
checking whether termios.h defines TIOCGWINSZ... no
checking whether sys/ioctl.h defines TIOCGWINSZ... yes
checking for TIOCSTAT in sys/ioctl.h... no
checking for FIONREAD in sys/ioctl.h... yes
checking whether WCONTINUED flag to waitpid is unavailable or available but broken... no
checking for speed_t in sys/types.h... no
checking whether getpw functions are declared in pwd.h... yes
checking for unusable real-time signals due to large values... no
checking for tgetent... no
checking for tgetent in -ltermcap... yes
checking which library has the termcap functions... using libtermcap
checking whether /dev/fd is available... standard
checking whether /dev/stdin stdout stderr are available... present
checking for default mail directory... /var/mail
checking shared object configuration for loadable builtins... supported
configure: creating ./config.status
config.status: creating Makefile
config.status: creating builtins/Makefile
config.status: creating lib/readline/Makefile
config.status: creating lib/glob/Makefile
config.status: creating lib/intl/Makefile
config.status: creating lib/malloc/Makefile
config.status: creating lib/sh/Makefile
config.status: creating lib/termcap/Makefile
config.status: creating lib/tilde/Makefile
config.status: creating doc/Makefile
config.status: creating support/Makefile
config.status: creating po/Makefile.in
config.status: creating examples/loadables/Makefile
config.status: creating examples/loadables/perl/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default-1 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing default commands
And this is my environment:
Code:
evans@evans-pc:~/bash-4.0$ env
ORBIT_SOCKETDIR=/tmp/orbit-evans
SSH_AGENT_PID=3322
GPG_AGENT_INFO=/tmp/seahorse-rJytMA/S.gpg-agent:3347:1
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=c65cbfd294f359ed82299fc14a0716bb-1242826098.545040-1444570916
GTK_RC_FILES=/etc/gtk/gtkrc:/home/evans/.gtkrc-1.2-gnome2
WINDOWID=44040245
GTK_MODULES=canberra-gtk-module
USER=evans
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:
LIBGL_DRIVERS_PATH=/usr/lib/dri:/usr/lib32/dri
GNOME_KEYRING_SOCKET=/tmp/keyring-8KsyKx/socket
SSH_AUTH_SOCK=/tmp/keyring-8KsyKx/socket.ssh
SESSION_MANAGER=local/evans-pc:/tmp/.ICE-unix/3261
USERNAME=evans
DESKTOP_SESSION=default
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
GDM_XSERVER_LOCATION=local
PWD=/home/evans/bash-4.0
LANG=en_US.UTF-8
GNOME_KEYRING_PID=3248
GDM_LANG=en_US.UTF-8
GDMSESSION=default
HISTCONTROL=ignoreboth
SHLVL=1
HOME=/home/evans
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=evans
XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-GxfZn4iU2D,guid=68710006908f3f29fab4b7134a140573
LESSOPEN=| /usr/bin/lesspipe %s
WINDOWPATH=7
DISPLAY=:0.0
LESSCLOSE=/usr/bin/lesspipe %s %s
XAUTHORITY=/home/evans/.Xauthority
COLORTERM=gnome-terminal
_=/usr/bin/env
OLDPWD=/home/evans
Please help me, thanks.
 
Old 05-21-2009, 09:22 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
For sure you should add the "-m32" compile option to CFLAGS and CXXFLAGS.
 
Old 05-22-2009, 03:24 AM   #3
smkururu
LQ Newbie
 
Registered: May 2009
Location: /dev/null
Distribution: Ubuntu Jaunty
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by H_TeXMeX_H View Post
For sure you should add the "-m32" compile option to CFLAGS and CXXFLAGS.
Add to where? to the environment? I tried
Code:
env CFLAGS="-m32"
env
and the first env shows that CFLAGS is set, but the second env printed no CFLAGS. I also tried using "set" and it's the same. Any ideas?
 
Old 05-22-2009, 04:08 AM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Do:

Code:
export CFLAGS+=" -m32"
export CXXFLAGS+=" -m32"
./configure
make
 
Old 05-22-2009, 07:54 AM   #5
soleilarw
Member
 
Registered: Apr 2009
Posts: 107

Rep: Reputation: 19
Does this work the other way around as well, by building 64-bit applications on 32-bit systems? I'm just curious.

Linux Archive

Last edited by soleilarw; 06-18-2009 at 04:00 AM.
 
Old 05-22-2009, 09:42 AM   #6
smkururu
LQ Newbie
 
Registered: May 2009
Location: /dev/null
Distribution: Ubuntu Jaunty
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by H_TeXMeX_H View Post
Do:

Code:
export CFLAGS+=" -m32"
export CXXFLAGS+=" -m32"
./configure
make
It doesn't work,
Code:
evans@evans-pc:~/bash-4.0$ export CFLAGS+=" -m32"
evans@evans-pc:~/bash-4.0$ export CXXFLAGS+=" -m32"
evans@evans-pc:~/bash-4.0$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for emacs... no
checking for xemacs... no

Beginning configuration for bash-4.0-release for x86_64-unknown-linux-gnu

checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: in `/home/evans/bash-4.0':
configure: error: C compiler cannot create executables
See `config.log' for more details.

### I'm trying to use linux32###

evans@evans-pc:~/bash-4.0$ linux32 ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for emacs... no
checking for xemacs... no

Beginning configuration for bash-4.0-release for i686-pc-linux-gnu

checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: in `/home/evans/bash-4.0':
configure: error: C compiler cannot create executables
See `config.log' for more details.
evans@evans-pc:~/bash-4.0$
config.log:
Code:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by bash configure 4.0-release, which was
generated by GNU Autoconf 2.63.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = evans-pc
uname -m = i686
uname -r = 2.6.28-11-generic
uname -s = Linux
uname -v = #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2090: checking build system type
configure:2108: result: i686-pc-linux-gnu
configure:2130: checking host system type
configure:2145: result: i686-pc-linux-gnu
configure:2226: checking for emacs
configure:2256: result: no
configure:2226: checking for xemacs
configure:2256: result: no
configure:2864: checking for gcc
configure:2880: found /usr/bin/gcc
configure:2891: result: gcc
configure:3123: checking for C compiler version
configure:3131: gcc --version >&5
gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3135: $? = 0
configure:3142: gcc -v >&5
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
configure:3146: $? = 0
configure:3153: gcc -V >&5
gcc: '-V' option must have argument
configure:3157: $? = 1
configure:3180: checking for C compiler default output file name
configure:3202: gcc  -m32 -m32   conftest.c  >&5
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.3/libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.3/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status
configure:3206: $? = 1
configure:3244: result: 
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "bash"
| #define PACKAGE_TARNAME "bash"
| #define PACKAGE_VERSION "4.0-release"
| #define PACKAGE_STRING "bash 4.0-release"
| #define PACKAGE_BUGREPORT "bug-bash@gnu.org"
| #define USING_BASH_MALLOC 1
| #define ALIAS 1
| #define PUSHD_AND_POPD 1
| #define RESTRICTED_SHELL 1
| #define PROCESS_SUBSTITUTION 1
| #define PROMPT_STRING_DECODE 1
| #define SELECT_COMMAND 1
| #define HELP_BUILTIN 1
| #define ARRAY_VARS 1
| #define DPAREN_ARITHMETIC 1
| #define BRACE_EXPANSION 1
| #define COMMAND_TIMING 1
| #define EXTENDED_GLOB 1
| #define COND_COMMAND 1
| #define COND_REGEXP 1
| #define COPROCESS_SUPPORT 1
| #define ARITH_FOR_COMMAND 1
| #define NETWORK_REDIRECTIONS 1
| #define PROGRAMMABLE_COMPLETION 1
| #define DEBUGGER 1
| #define CASEMOD_ATTRS 1
| #define CASEMOD_EXPANSIONS 1
| #define MEMSCRAMBLE 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3250: error: in `/home/evans/bash-4.0':
configure:3253: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnu
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=' -m32 -m32'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_DEBUGGER_START_FILE_set=
ac_cv_env_DEBUGGER_START_FILE_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_YACC_set=
ac_cv_env_YACC_value=
ac_cv_env_YFLAGS_set=
ac_cv_env_YFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-pc-linux-gnu
ac_cv_prog_ac_ct_CC=gcc

## ----------------- ##
## Output variables. ##
## ----------------- ##

ALLOCA=''
AR=''
ARFLAGS=''
BASHVERS='4.0'
BUILD_DIR=''
BUILD_INCLUDED_LIBINTL=''
CATOBJEXT=''
CC='gcc'
CC_FOR_BUILD=''
CFLAGS=' -m32 -m32'
CFLAGS_FOR_BUILD=''
CPP=''
CPPFLAGS=''
CPPFLAGS_FOR_BUILD=''
CROSS_COMPILE=''
DATADIRNAME=''
DEBUG=''
DEBUGGER_START_FILE='${datadir}/bashdb/bashdb-main.inc'
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EMACS='no'
EXEEXT=''
GENCAT=''
GLIBC21=''
GMSGFMT=''
GREP=''
HELPDIR=''
HELPDIRDEFINE=''
HELPINSTALL=''
HELPSTRINGS=''
HISTORY_DEP=''
HISTORY_LIB=''
HIST_LIBDIR=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTOBJEXT=''
INTLBISON=''
INTLLIBS=''
INTLOBJS=''
INTL_DEP=''
INTL_INC=''
INTL_LIBTOOL_SUFFIX_PREFIX=''
JOBS_O=''
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LIBICONV=''
LIBINTL=''
LIBINTL_H=''
LIBOBJS=''
LIBS=''
LOCAL_CFLAGS=''
LOCAL_DEFS=''
LOCAL_LDFLAGS=''
LOCAL_LIBS=''
LTLIBICONV=''
LTLIBINTL=''
LTLIBOBJS=''
MAKE_SHELL=''
MALLOC_DEBUG=''
MALLOC_DEP='$(MALLOC_LIBRARY)'
MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)'
MALLOC_LIB='-lmalloc'
MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a'
MALLOC_SRC='malloc.c'
MALLOC_TARGET='malloc'
MKINSTALLDIRS=''
MSGFMT=''
MSGMERGE=''
OBJEXT=''
PACKAGE_BUGREPORT='bug-bash@gnu.org'
PACKAGE_NAME='bash'
PACKAGE_STRING='bash 4.0-release'
PACKAGE_TARNAME='bash'
PACKAGE_VERSION='4.0-release'
PATH_SEPARATOR=':'
POSUB=''
PROFILE_FLAGS=''
PURIFY=''
RANLIB=''
READLINE_DEP=''
READLINE_LIB=''
RELSTATUS='release'
RL_INCLUDE=''
RL_INCLUDEDIR=''
RL_LIBDIR=''
RL_MAJOR=''
RL_MINOR=''
RL_VERSION=''
SET_MAKE=''
SHELL='/bin/bash'
SHOBJ_CC=''
SHOBJ_CFLAGS=''
SHOBJ_LD=''
SHOBJ_LDFLAGS=''
SHOBJ_LIBS=''
SHOBJ_STATUS=''
SHOBJ_XLDFLAGS=''
SIGLIST_O=''
SIGNAMES_H=''
SIGNAMES_O=''
SIZE=''
STATIC_LD=''
TERMCAP_DEP=''
TERMCAP_LIB=''
TESTSCRIPT='run-all'
TILDE_LIB=''
USE_INCLUDED_LIBINTL=''
USE_NLS=''
XGETTEXT=''
YACC=''
YFLAGS=''
ac_ct_CC='gcc'
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias=''
build_cpu='i686'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='i686-pc-linux-gnu'
host_alias=''
host_cpu='i686'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
incdir=''
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
lispdir=''
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME "bash"
#define PACKAGE_TARNAME "bash"
#define PACKAGE_VERSION "4.0-release"
#define PACKAGE_STRING "bash 4.0-release"
#define PACKAGE_BUGREPORT "bug-bash@gnu.org"
#define USING_BASH_MALLOC 1
#define ALIAS 1
#define PUSHD_AND_POPD 1
#define RESTRICTED_SHELL 1
#define PROCESS_SUBSTITUTION 1
#define PROMPT_STRING_DECODE 1
#define SELECT_COMMAND 1
#define HELP_BUILTIN 1
#define ARRAY_VARS 1
#define DPAREN_ARITHMETIC 1
#define BRACE_EXPANSION 1
#define COMMAND_TIMING 1
#define EXTENDED_GLOB 1
#define COND_COMMAND 1
#define COND_REGEXP 1
#define COPROCESS_SUPPORT 1
#define ARITH_FOR_COMMAND 1
#define NETWORK_REDIRECTIONS 1
#define PROGRAMMABLE_COMPLETION 1
#define DEBUGGER 1
#define CASEMOD_ATTRS 1
#define CASEMOD_EXPANSIONS 1
#define MEMSCRAMBLE 1

configure: exit 77
Any Ideas?
Quote:
Does this work the other way around as well, by building 64-bit applications on 32-bit systems? I'm just curious.
AFAIK, yes, you can, but not running it in 32 bit.
 
Old 05-22-2009, 10:00 AM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
See here:
http://ubuntuforums.org/showthread.php?t=17033

Make sure to install 'libc6-dev-i386' as well as 'libc6-i386', and of course the 32-bit gcc if you don't have it. So basically install all the necessary 32-bit toolchain to compile programs ... gcc, glib, glibc, etc.
 
Old 05-22-2009, 11:01 AM   #8
smkururu
LQ Newbie
 
Registered: May 2009
Location: /dev/null
Distribution: Ubuntu Jaunty
Posts: 11

Original Poster
Rep: Reputation: 0
It appears, now the problem change. After setting the environment using
Code:
export CFLAGS+=" -m32"
export CXXFLAGS+=" -m32"
and then ./configure , when I type make, another problem appear.
Code:
evans@evans-pc:~/bash-4.0$ make
/bin/sh ./support/mkversion.sh -b -S . -s release -d 4.0 -o newversion.h \
		&& mv newversion.h version.h
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"x86_64-unknown-linux-gnu"' -DCONF_VENDOR='"unknown"' -DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g  -DBUILDTOOL -c -o buildversion.o ./version.c
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"x86_64-unknown-linux-gnu"' -DCONF_VENDOR='"unknown"' -DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g  -o bashversion ./support/bashversion.c buildversion.o 

	  ***********************************************************
	  *                                                         *
	  * GNU bash, version 4.0.0(2)-release (x86_64-unknown-linux-gnu)
	  *                                                         *
	  ***********************************************************

make[1]: Entering directory `/home/evans/.local/share/Trash/files/bash-4.21.0/builtins'
gcc -L./lib/termcap -rdynamic -m32 -rdynamic -g  -o mkbuiltins mkbuiltins.o -ldl 
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/bin/ld: i386:x86-64 architecture of input file `mkbuiltins.o' is incompatible with i386 output
make[1]: *** [mkbuiltins] Error 1
make[1]: Leaving directory `/home/evans/.local/share/Trash/files/bash-4.21.0/builtins'
make: *** [builtins/builtext.h] Error 1
evans@evans-pc:~/bash-4.0$
Please help me.
 
Old 05-22-2009, 11:11 AM   #9
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Do a 'make clean' then try again.
 
Old 05-22-2009, 11:25 AM   #10
smkururu
LQ Newbie
 
Registered: May 2009
Location: /dev/null
Distribution: Ubuntu Jaunty
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by H_TeXMeX_H View Post
Do a 'make clean' then try again.
I assume what do you mean is do a make clean after ./configure and make (even the make failed). Is that correct? After make clean and once again make, the problem remains the same. By the way, when doing make, I saw this line seems important:
Code:
/usr/bin/ld: i386:x86-64 architecture of input file `mkbuiltins.o' is incompatible with i386 output
Maybe it'll somehow helpful?
 
Old 05-22-2009, 11:40 AM   #11
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Just start over, delete the directory that was made and extract the source again from the archive you downloaded. It seems to me that `mkbuiltins.o' is or was compiled as 64-bit and now the linker won't accept it in a 32-bit executable. So you need to get rid of `mkbuiltins.o' it should be in ./builtins, but 'make clean' should technically get rid of it.
 
Old 05-22-2009, 11:52 AM   #12
smkururu
LQ Newbie
 
Registered: May 2009
Location: /dev/null
Distribution: Ubuntu Jaunty
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by H_TeXMeX_H View Post
Just start over, delete the directory that was made and extract the source again from the archive you downloaded. It seems to me that `mkbuiltins.o' is or was compiled as 64-bit and now the linker won't accept it in a 32-bit executable. So you need to get rid of `mkbuiltins.o' it should be in ./builtins, but 'make clean' should technically get rid of it.
Actually, I always start over by deleting the directory and extract the folder over and over. Before I started (before configure) there are no mkbuiltins.o in builtins directory. In fact, there are no .o in the Project's directory. (Honestly, I don't know 'make clean' before.)
 
Old 05-31-2009, 02:33 PM   #13
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474
Blog Entries: 28

Rep: Reputation: 34
Linux32: Before all else...

Quote:
Originally Posted by smkururu View Post
I assume what do you mean is do a make clean after ./configure and make (even the make failed). Is that correct? After make clean and once again make, the problem remains the same. By the way, when doing make, I saw this line seems important:
Code:
/usr/bin/ld: i386:x86-64 architecture of input file `mkbuiltins.o' is incompatible with i386 output
Maybe it'll somehow helpful?
I think you have to run "linux32 make". That was my experience when running a 64-bit kernel on a Slackware 32-bit system. Essentially, linux32 must precede any command which requires identification of the system.

Shingoshi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile 32-bit kernel on a 64-bit machine kushalkoolwal Debian 6 06-15-2009 05:48 PM
How to find if an OS is 32 bit or 64 bit using a program ? lali.p Programming 12 05-24-2009 12:51 AM
[SOLVED] File size limitations of a 32 bit program running under a 64 bit kernel acerostech Linux - Server 1 04-19-2009 10:01 AM
32-bit to 64-bit migration for c++ program newbix Programming 3 01-15-2008 07:27 PM
Assembling a 32 bit sample program in a 64 bit world debiant Programming 0 10-14-2006 02:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration