Build and install an o32 set of libraries on mips64 suitable for running
o32 binaries via COMPAT_FREEBSD32. Enable COMPAT_FREEBSD32 in MALTA64.
Details
- Run mips o32 binaries under a MALTA64 kernel in qemu.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Makefile.libcompat | ||
---|---|---|
43 ↗ | (On Diff #23581) | I could perhaps move the OBJCOPY bits out of the .ifdef, though if I did that I would probably just make that part MI as it's the same value on amd64 and powerpc as well. |
This looks good to me, though it'd be nice to see the default ISA thing resolved or confirmed. I also do favour collapsing the target emulation stuff more as possible, but it's not worth holding this up.
Makefile.libcompat | ||
---|---|---|
37 ↗ | (On Diff #23581) | I think this is wrong. Do we in other places use -march=mips64 as the default for 64-bit MIPS? I thought we used MIPS III as the base target ISA for 64-bit MIPS, in which case we'd certainly want likewise for the o32 libs for an otherwise-unspecified 64-bit MIPS system. But then, I'm basically of the belief that TARGET_CPUTYPE ought to be required on MIPS. What does GCC default to? |
Makefile.libcompat | ||
---|---|---|
37 ↗ | (On Diff #23581) | I'm not sure what we use as the base as it is some local hack we have to gcc 4.2.1 to set the default ABI. To use an external toolchain I have to set a default CPUTYPE when building (so just using TARGET_ARCH=mips fails to build with external GCC for example). I have a pending patch to set a minimum -march= in bsd.cpu.mk. My guess was to use -march=mips32 for o32 and -march=mips64 for n64/n32. If you have a better suggestion we can use something else. |
Makefile.libcompat | ||
---|---|---|
37 ↗ | (On Diff #23581) | It looks like with GCC in base we internally use the ISA "from-abi", except for 32-bit binaries, for which we default to mips3, so we don't end up with MIPS I ISA awfulness. So I suppose we should use -march=mips3 here, to match gnu/usr.bin/cc/Makefile.inc. |
Makefile.libcompat | ||
---|---|---|
37 ↗ | (On Diff #23581) | Hmmm, ok. In this case we know are building for a 64-bit capable CPU though (e.g. on FreeBSD/amd64 the 32-bit libc can assume SSE2 is present even though it's not available on all i386 CPUs because the lib32 libc will only be present on amd64 CPUs which do always have SSE2). Not sure if there is a minimum -march= setting for 64-bit mips that is above mips3. If not, I'm fine with using mips3. |
Makefile.libcompat | ||
---|---|---|
37 ↗ | (On Diff #23581) | MIPS-III is the 32-bit and 64-bit baseline for FreeBSD, so it's appropriate here. We depend on MIPS-III features, and anything above that is optional, and requires a CPUTYPE be specified. |
- Rebase.
- Use mips3 instead of mips64 as default -march.
- Pull OBJCOPY override out if .ifdef.
This looks good, modulo one or two nits. The unrelated changes can be lumped in if it's a big hassle. The emulation stuff is OK to go in, but it will likely get grumps from kan@.
Makefile.libcompat | ||
---|---|---|
11–16 ↗ | (On Diff #23675) | Perhaps this should be done as a separate commit, since it is not mips related. |
26–28 ↗ | (On Diff #23675) | likewise. |
43 ↗ | (On Diff #23675) | This undoes, a little, kan@'s moves to not specify the name here because it's inconsistent between internal and external toolchains. |
Makefile.libcompat | ||
---|---|---|
11–16 ↗ | (On Diff #23675) | Hmm, I can. |
43 ↗ | (On Diff #23675) | No, this works fine with external GCC./binutils. The thing that is different is the internal name in linker scripts (upstream binutils appends "-freebsd" to the OUTPUT_FORMAT() string). The linker emulation names are the same for both. |