You are not logged in.

#1 2011-06-28 19:19:23

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

compile i686 packages on x86_64 without a chroot [solved]

According to this wiki page, one can compile i686 under x86_64 without a chroot using the gcc from [multilib].  I have yet to figure out how to accomplish this using makepkg.

I found this thread from 2 years ago that talks about using the -m32 switch within the CFLAGS.  I tried this using a ~/.makepkg.conf which as I understand it overrides values in /etc/makepkg.conf building the kernel26 package with ABS, but what I found is that makepkg used the config.x86_64 file, not the config despite my values listed below.

How can I compile kernel26 on x86_64 natively without using a 32-bit chroot?

$ cat ~/.makepkg.conf
ARCH="i686"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -pipe -m32"
CXXFLAGS="-march=i686 -O2 -pipe -m32"
MAKEFLAGS="-j4"
BUILDENV=(fakeroot !distcc color !ccache !check)

EDIT: I should mention that I have the group "multilib-devel" installed:

$ for i in gcc-multilib gcc-libs-multilib binutils-multilib libtool-multilib lib32-glibc; do pacman -Ss $i; done
multilib/gcc-multilib 4.6.0-7 (multilib-devel) [installed]
    The GNU Compiler Collection - C and C++ frontends for multilib
multilib/gcc-libs-multilib 4.6.0-7 [installed]
    Runtime libraries shipped by GCC for multilib
multilib/binutils-multilib 2.21-9 (multilib-devel) [installed]
    A set of programs to assemble and manipulate binary and object files for multilib
multilib/libtool-multilib 2.4-2 (multilib-devel) [installed]
    A generic library support script for multilib
multilib/lib32-glibc 2.14-4 [installed]
    GNU C Library for multilib

Last edited by graysky (2011-07-01 20:57:28)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2011-06-29 09:47:32

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: compile i686 packages on x86_64 without a chroot [solved]

try this :

$ makepkg --config ~/.makepkg.conf

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2011-06-29 12:49:49

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: compile i686 packages on x86_64 without a chroot [solved]

no linux32?

Offline

#4 2011-06-29 20:00:30

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: compile i686 packages on x86_64 without a chroot [solved]

@Lone_Wolf - oddly enough, it ignores the ARCH="i686" in the file!

$ makepkg -s  --config ~/.makepkg.conf
==> ERROR: kernel26-ck is not available for the '' architecture.
    Note that many packages may need a line added to their PKGBUILD
    such as arch=('').

@JB - tried it....

$ linux32 makepkg -s
...
...
...
patching file include/net/inet_timewait_sock.h
patching file init/calibrate.c
patching file kernel/Kconfig.preempt
patching file Makefile
==> Running make mrproper to clean source tree
Makefile:555: /dev/shm/kernel26-ck/src/linux-2.6.39/arch/i686/Makefile: No such file or directory
make: *** No rule to make target `/dev/shm/kernel26-ck/src/linux-2.6.39/arch/i686/Makefile'.  Stop.
==> ERROR: A failure occurred in build().
    Aborting...

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2011-07-01 18:22:00

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: compile i686 packages on x86_64 without a chroot [solved]

ARCH="i686"

Try  CARCH="i686" instead


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#6 2011-07-01 19:50:41

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: compile i686 packages on x86_64 without a chroot [solved]

Lone_Wolf wrote:
ARCH="i686"

Try  CARCH="i686" instead

Pairing that modification (typeo on my part actually) with linux32 seems to work!

1) Add the following lines to ~/.makepkg.conf

CARCH="i686"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -pipe -m32"
CXXFLAGS="${CFLAGS}"

2) Start makepkg w/ the linux32 prefix:

$ linux32 makepkg -s

EDIT: Updated the wiki page w/ relevant info.

Last edited by graysky (2011-07-01 21:00:29)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB