Project

General

Profile

Bug #791

Support cross-compiling for other architectures without need extra dependencies

Anonymous - about 5 years ago - . Updated over 4 years ago.

Status:
fixed
Priority:
feature
Category:
ARM on x86
Assignee:
% Done:

100%


Description

Add cross-compiling support to build multiple architectures without need extra dependencies

  • support cross-compiling configuration
  • no need extra dependencies like libretools-mips64el
  • no need extra steps to build and upload packages
  • easy to use libremakepkg/librestage/librerelease

https://labs.parabola.nu/issues/787


Related issues

Related to dbscripts - Bug #808: Package [dbscripts] similarly to libretools for easy use in Parabola serverfixed2015-09-22

Actions
Blocked by libretools - Porting #787: [librechroot] Support ARM chroots on x86 via QEMUfixed2015-08-19

Actions

History

#1

Updated by Anonymous about 5 years ago

  • Related to Porting #787: [librechroot] Support ARM chroots on x86 via QEMU added
#2

Updated by Anonymous about 5 years ago

coadde wrote:

Add cross-compiling support to build multiple architectures without need extra dependencies

  • support cross-compiling configuration
  • no need extra dependencies like libretools-mips64el
  • no need extra steps to build and upload packages
  • easy to use libremakepkg/librestage/librerelease

https://labs.parabola.nu/issues/787

Add pacman flags, example:
  • CC and CPP (for native-gcc, crosscompiling-gcc and clang support)
  • TARCH (for package-tarball build [*-${TARCH}.pkg.tar.xz])
  • CTARGET (for cross-compiling compilation):

example - (crosscompiling_build-mips64el):

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CC=mips64el-unknown-linux-gnu-gcc
CPP=mips64el-unknown-linux-gnu-g++
CARCH="x86_64" 
TARCH="mips64el" 
CHOST="x86_64-unknown-linux-gnu" 
CTARGET="mips64el-unknown-linux-gnu" 

#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS="-D_FORTIFY_SOURCE=2" 
CFLAGS="-march=mips64el -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4" 
CXXFLAGS="-march=mips64el -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4" 
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu" 
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j4" 
#-- Debugging flags
DEBUG_CFLAGS="-g -fvar-tracking-assignments" 
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments" 


example - (native_build-x86_64):

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CC=gcc
#CC=clang
CPP=g++
#CPP=clang++
CARCH="x86_64" 
TARCH="${CARCH}" 
CHOST="x86_64-unknown-linux-gnu" 
CTARGET="${CHOST}" 

#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS="-D_FORTIFY_SOURCE=2" 
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4" 
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4" 
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu" 
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j4" 
#-- Debugging flags
DEBUG_CFLAGS="-g -fvar-tracking-assignments" 
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments" 

#3

Updated by Anonymous about 5 years ago

  • Related to Bug #807: [librechroot] Support using proot to call QEMU for foreign architectures added
#4

Updated by Anonymous about 5 years ago

  • Related to Bug #808: Package [dbscripts] similarly to libretools for easy use in Parabola server added
#5

Updated by Anonymous about 5 years ago

  • Related to Bug #790: Add support QEMU in chroot on nonnative architecture to build other systems without need to use cross-compiling added
#6

Updated by lukeshu over 4 years ago

  • Subject changed from Add cross-compiling support to build multiple architectures without need extra dependencies to Support cross-compiling for other architectures without need extra dependencies

I'm down with most of this, but I'm not sure about dropping having a libretools-cross-${CARCH} (or somesuch) for cross-compiling. For one, it'd be silly to require qemu be installed on an ARM device to cross-compile for ARM. Similarly, it'd be silly to require that qemu be installed on ARM devices to cross-compile for x86, since ARM devices are typically under-powered.

#7

Updated by lukeshu over 4 years ago

  • Related to deleted (Bug #807: [librechroot] Support using proot to call QEMU for foreign architectures)
#8

Updated by lukeshu over 4 years ago

  • Target version set to Better ARM support
  • Category set to ARM on x86
#9

Updated by lukeshu over 4 years ago

  • Related to deleted (Bug #790: Add support QEMU in chroot on nonnative architecture to build other systems without need to use cross-compiling)
#10

Updated by lukeshu over 4 years ago

  • Related to deleted (Porting #787: [librechroot] Support ARM chroots on x86 via QEMU)
#11

Updated by lukeshu over 4 years ago

  • Blocked by Porting #787: [librechroot] Support ARM chroots on x86 via QEMU added
#12

Updated by lukeshu over 4 years ago

  • Status changed from open to info needed

So, this is added, except for extra dependencies.

Is everyone ok with having the optdepend binftm-qemu-static: To build ARM packages from x86?

#13

Updated by Anonymous over 4 years ago

yes

#14

Updated by lukeshu over 4 years ago

  • % Done changed from 0 to 100
  • Status changed from info needed to fixed

Alright then!

Also available in: Atom PDF