[2/4] Allow make-link-multidir to make subdirectories

Message ID 20180106073231.20491-3-palmer@dabbelt.com
State New
Headers show
Series
  • [1/4] Add RISC-V dynamic relocations to elf.h
Related show

Commit Message

Palmer Dabbelt Jan. 6, 2018, 7:32 a.m.
The RISC-V Linux ABI doesn't define any libraries that go directly in
lib, instead they go into lib/ilp32 or lib/lp64.  This casuse
make-link-multidir to fail when attempting to make library directories
when building a static libc on multilib RISC-V systems.

This patch uses scripts/mkinstalldirs to make the base directory of the
target symlink of make-link-multidir.
---
 ChangeLog | 4 +++-
 Makerules | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Zack Weinberg Jan. 6, 2018, 3:04 p.m. | #1
On Sat, Jan 6, 2018 at 2:32 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
> The RISC-V Linux ABI doesn't define any libraries that go directly in
> lib, instead they go into lib/ilp32 or lib/lp64.

Why did you invent a new convention for this, instead of using the
existing lib{32,64} or lib/<target-triple> conventions?

zw
Palmer Dabbelt Jan. 6, 2018, 8:12 p.m. | #2
On Sat, 06 Jan 2018 07:04:45 PST (-0800), zackw@panix.com wrote:
> On Sat, Jan 6, 2018 at 2:32 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>> The RISC-V Linux ABI doesn't define any libraries that go directly in
>> lib, instead they go into lib/ilp32 or lib/lp64.
>
> Why did you invent a new convention for this, instead of using the
> existing lib{32,64} or lib/<target-triple> conventions?

Sorry, the message was a bit truncated.  We currently install libraries in the 
following directories:

* lib32/ilp32: RV32 (the 32-bit ISA), with the 32-bit soft float ABI
* lib32/ilp32d: RV32, with the 32-bit hard float ABI
* lib64/lp64: RV64 (the 64-bit ISA), with the 64-bit soft float ABI
* lib64/lp64d: RV64, 64-bit hard float

we plan on eventually also supporting lib64/ilp32 and lib64/ilp32d (x32-style 
ABIs).

The convention is slightly different because we wanted thing regular: we could 
have picked something like "lib32" and "lib32/softfloat" (IIRC ARM does this), 
but it seemed better to make thing orthogonal.

Patch

diff --git a/ChangeLog b/ChangeLog
index d0e02b0b1f43..aeab82520a1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@ 
-2018-01-05  Palmer Dabbelt  <palmer@sifive.com>
+2018-01-06  Palmer Dabbelt  <palmer@sifive.com>
 
 	* elf/elf.h (R_RISCV_NONE): New define.
 	(R_RISCV_32): Likewise.
@@ -12,6 +12,8 @@ 
 	(R_RISCV_TLS_DTPREL64): Likewise.
 	(R_RISCV_TLS_TPREL32): Likewise.
 	(R_RISCV_TLS_TPREL64): Likewise.
+	* Makerules (make-link-multidir): Make directories before linking into
+	them.
 
 2018-01-06  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
diff --git a/Makerules b/Makerules
index d94e4ca0c18f..ef6abeac6d9d 100644
--- a/Makerules
+++ b/Makerules
@@ -1081,6 +1081,7 @@  mv -f $@.new $@
 endef
 define make-link-multidir
 $(patsubst %/,cd %,$(objpfx)); \
+  $(addprefix $(abspath $(..)scripts/mkinstalldirs) ,$(dir $(multidir))); \
   $(LN_S) . $(multidir) 2> /dev/null; \
   test -L $(multidir)
 endef