mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl-based toolchain for J2/SH-2
@ 2015-08-26 17:42 Rich Felker
  2015-08-26 18:08 ` musl-based toolchain for J2/SH-2 - kernel patches Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Rich Felker @ 2015-08-26 17:42 UTC (permalink / raw)
  To: 0pf; +Cc: musl, nommu

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-26 18:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-26 17:42 musl-based toolchain for J2/SH-2 Rich Felker
2015-08-26 18:08 ` musl-based toolchain for J2/SH-2 - kernel patches Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).