Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150826174212.GO32742@brightrain.aerifal.cx>
Date: Wed, 26 Aug 2015 13:42:12 -0400
From: Rich Felker <dalias@...c.org>
To: 0pf@...mu.org
Cc: musl@...ts.openwall.com, nommu@...mu.org
Subject: musl-based toolchain for J2/SH-2

I've packaged up a small cross-compiler-toolchain build script that's
especially geared towards use with the Open Processor Foundation's J2
Core, which uses the SH-2 ISA, and in the future other NOMMU archs:

https://github.com/richfelker/musl-cross-make

Some special toolchain considerations are needed to support targets
without an MMU. Unlike the legacy uClinux approach of using a custom
binary format with its own encoding of relocations/fixups, musl's
approach to NOMMU uses the standard ELF binary format, and binaries
are forwards-compatible with cpu models that do have an MMU.

Since it's necessary for programs to be loadable at arbitrary
addresses (due to the lack of virtual memory), position-independent
executables (PIE) are mandatory. This toolchain is patched to produce
PIE by default (similar to what's done on various hardened Linux
distributions) and to make it possible to use static linking alongside
PIE.

Some of the PIE-related work is only complete for SH (including J2)
targets. I don't plan to spend more time on adding static-PIE support
for other archs to binutils 2.25.1 because I already have a proposed
patch for binutils git master that will hopefully make it into the
next binutils release; if it doesn't, at least that patch should
cleanly apply to the next binutils release. I do plan to add GCC-side
coverage for other archs with the aim of producing a patch suitable
for upstream GCC.

The FDPIC ABI variant, which would be needed to support shareable text
and execute-in-place, is not yet supported by musl, nor does upstream
GCC have support for SH FDPIC code generation. This will be added
later.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.