Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MIPS Cross Compilation on Travis

How would one setup a .travis.yml to do cross compilation for MIPS target ? For PowerPC, this is trivial:

addons:
    apt:
      packages:
         - gcc-powerpc-linux-gnu

Since I have access to the package directly.

For MIPS I cannot find a compiler for it in Ubuntu Trusty:

  • Software Packages in "trusty", Subsection devel

Even though it appears to be whitelisted:

  • https://github.com/travis-ci/apt-package-whitelist/commit/5761eccc#diff-3583c6522a64da63a272436df8de85ceR1311

It seems I would need an updated Ubuntu image (not possible on Travis):

  • GNU C compiler for the mips architecture

The alternate solution would be to use some pre-build MIPS compiler, eg:

  • Sourcery CodeBench Lite 2013.11-36 for MIPS GNU/Linux

But documentation rather explicitely says not to cache those things:

  • Caching Dependencies and Directories#Things not to cache

Large files that are quick to install but slow to download do not benefit from caching, as they take as long to download from the cache as from the original source:

  • Android SDKs
  • Debian packages
  • JDK packages
  • Compiled binaries
  • Docker images

How would you install a mips cross compiler on the default Ubuntu Travis image ?


Update I tried a naive solution:

addons:
  apt:
    sources:
    - debian-sid
    packages:
    - gcc-mips-linux-gnu

But this fails with:

dpkg-deb: error: archive '/var/cache/apt/archives/gcc-7-base_7.2.0-18_amd64.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/gcc-7-base_7.2.0-18_amd64.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2

It seems dpkg in Ubuntu/Trusty will not support those deb files:

  • xz compressed control.tar files not supported
like image 903
malat Avatar asked Feb 28 '26 05:02

malat


1 Answers

It seems I cannot use container based because of this requirement, I gave up and simply used:

sudo: true
dist: trusty

addons:
  apt:
    packages:
    - u-boot-tools

before_install:
  - sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu/ xenial main universe"
  - sudo apt-get -qq update
  - sudo apt-get install -qq gcc-mips-linux-gnu

I am still intrigued by the fact that gcc-mips-linux-gnu is explicitly white-listed.

like image 135
malat Avatar answered Mar 02 '26 20:03

malat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!