Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build bitmanip multilib with linux 64 bit toolchain #1215

Closed
amitch1999 opened this issue Mar 19, 2023 · 12 comments
Closed

Can't build bitmanip multilib with linux 64 bit toolchain #1215

amitch1999 opened this issue Mar 19, 2023 · 12 comments

Comments

@amitch1999
Copy link

Hi, I'm trying to build a linux 64 bit toolchain with the following multilib permutations: rv64imac-lp64, rv64imac_zbs_zbc_zbb_zba-lp64, rv64imafdc-lp64d, rv64imafdc_zbs_zbc_zbb_zba-lp64d.
Build from source hash: 170a9a3045207e3ed4d396f6c4f03e1c7978b0e4
my config line:
../riscv-gnu-toolchain/configure --with-arch=rv64imafdc --with-abi=lp64d --enable-multilib --with-multilib-generator="rv64imac-lp64-- rv64imac_zbs_zbc_zbb_zba-lp64-- rv64imafdc-lp64d-- rv64imafdc_zbs_zbc_zbb_zba-lp64d" --prefix=/scratch/riscv/gnu-workspace/install-collab-linux-64-bitmanip
And make linux after.
The build finishes fine with no errors, but when I use -print-multi-lib on gcc all I get is:
.; lib32/ilp32;@march=rv32imac@mabi=ilp32 lib32/ilp32d;@march=rv32imafdc@mabi=ilp32d lib64/lp64;@march=rv64imac@mabi=lp64
Without the bitmanip multilib I requested in the config line, and with 32 bit libraries that were not listed.
This is also the same output I get from -print-multi-lib when I config and build with no --with-multilib-generator at all, and only --enable-multilib as though it ignores --with-multilib-generator

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Mar 19, 2023

--with-multilib-generator=... only works for the newlib bare metal toolchain at the moment. See here:

For the Linux toolchain you'll have to edit/override the t-linux-multilib file and use configure ... --enable-multilib.

You may or may not also have issues with canonicalised architecture strings depending on what libraries you are building. This is an ongoing issue with certain aspects of the toolchain, especially with certain multilib configurations.

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Mar 19, 2023

my config line: ../riscv-gnu-toolchain/configure --with-arch=rv64imafdc --with-abi=lp64d --enable-multilib --with-multilib-generator="rv64imac-lp64-- rv64imac_zbs_zbc_zbb_zba-lp64-- rv64imafdc-lp64d-- rv64imafdc_zbs_zbc_zbb_zba-lp64d" --prefix=/scratch/riscv/gnu-workspace/install-collab-linux-64-bitmanip

Note that --with-arch=rv64imafdc --with-abi=lp64d aka rv64gc/lp64d is the default native arch/abi for the toolchain so you don't actually have to specify them at configuration time.

@TommyMurphyTM1234
Copy link
Collaborator

This is how I would approach building the multilib toolchain that you need:

git clone --recursive https://github.com/riscv-collab/riscv-gnu-toolchain issue-1215
cd issue-1215
pushd
cd gcc/gcc/config/riscv
./multilib-generator rv64imac-lp64-- rv64imac_zbs_zbc_zbb_zba-lp64-- rv64imafdc_zbs_zbc_zbb_zba-lp64d-- > t-linux-multilib
popd
./configure --prefix=`pwd`/installed-tools --enable-multilib
date > build.log && make linux 2>&1 | tee -a build.log && date >> build.log

Note that there is no need to specify the multilib rv64imafdc-lp64d-- since rv64imafdc/lp64d aka rv64gc/lp64d is the default arch/abi for the toolchain in the absence of this being overridden at configure time using --with-arch=... --with-abi=... - so the libraries/startup code/etc. for rv64gc/lp64d are generated automatically anyway.

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Mar 20, 2023

Hmmmm... I tried that myself and it failed for some reason - oddly while attempting to build some rv32imac/ilp32 stuff which doesn't make sense to me since no rv32 multilibs were specified via t-linux-multilib.

a - elf/libc_early_init.os
for symbol in __GI___pthread_disable_asynccancel __GI___pthread_enable_asynccancel __libc_assert_fail __pthread_disable_asynccancel __pthread_enable_asynccancel calloc free malloc realloc  __stack_chk_fail __stack_chk_fail_local; do \
	echo ".globl $symbol"; \
	echo "$symbol:"; \
done | riscv64-unknown-linux-gnu-gcc -march=rv32imac -mabi=ilp32 -o /home/tommy/Downloads/issue-1215/build-glibc-linux-rv32imac-ilp32/elf/librtld.mapT.o -g -Werror=undef -Wa,--noexecstack  -c -x assembler -
riscv64-unknown-linux-gnu-gcc -march=rv32imac -mabi=ilp32   -nostdlib -nostartfiles -r -o /home/tommy/Downloads/issue-1215/build-glibc-linux-rv32imac-ilp32/elf/librtld.map.o /home/tommy/Downloads/issue-1215/build-glibc-linux-rv32imac-ilp32/elf/librtld.mapT.o '-Wl,-(' /home/tommy/Downloads/issue-1215/build-glibc-linux-rv32imac-ilp32/elf/dl-allobjs.os /home/tommy/Downloads/issue-1215/build-glibc-linux-rv32imac-ilp32/libc_pic.a -lgcc '-Wl,-)' -Wl,-Map,/home/tommy/Downloads/issue-1215/build-glibc-linux-rv32imac-ilp32/elf/librtld.mapT
/home/tommy/Downloads/issue-1215/installed-tools/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: /home/tommy/Downloads/issue-1215/installed-tools/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/libgcc.a(div.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/home/tommy/Downloads/issue-1215/installed-tools/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: failed to merge target specific data of file /home/tommy/Downloads/issue-1215/installed-tools/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/libgcc.a(div.o)
/home/tommy/Downloads/issue-1215/installed-tools/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: attempt to do relocatable link with elf64-littleriscv input and elf32-littleriscv output
/home/tommy/Downloads/issue-1215/installed-tools/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: /home/tommy/Downloads/issue-1215/installed-tools/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/libgcc.a(div.o): file class ELFCLASS64 incompatible with ELFCLASS32
/home/tommy/Downloads/issue-1215/installed-tools/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: final link failed: file in wrong format
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1289: /home/tommy/Downloads/issue-1215/build-glibc-linux-rv32imac-ilp32/elf/librtld.map] Error 1
make[3]: Leaving directory '/home/tommy/Downloads/issue-1215/glibc/elf'
make[2]: *** [Makefile:484: elf/subdir_lib] Error 2
make[2]: Leaving directory '/home/tommy/Downloads/issue-1215/glibc'
make[1]: *** [Makefile:9: all] Error 2
make[1]: Leaving directory '/home/tommy/Downloads/issue-1215/build-glibc-linux-rv32imac-ilp32'

Full build.log: build.log.tar.gz

@TommyMurphyTM1234
Copy link
Collaborator

Maybe I'm hitting the same or similar issues here as described in this issue?

@amitch1999
Copy link
Author

amitch1999 commented Mar 21, 2023

Hi Tommy, thanks for the quick response.
After creating a custom t-linux-multilib file I encountered the same error as you did, and after looking in issue #1126 you mentioned I've manged to get it build by editing configure and changing glibc_multilib_names and newlib_multilib_names to list my wanted permutations.
And it looks like it did build glibc with my permutations (I saw it created folders named "build-glibc-linux-rv64i...") but now when I invoke riscv64-unknown-linux-gnu-gcc -print-multi-lib it's printing only lib64/lp64;@march=rv64imac@mabi=lp64.
Now, I'm not sure how to check if it actually built them, and where they are suppose to be in my install folder. Maybe only the print is wrong? and they are actually available?

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Mar 21, 2023

Hi Tommy, thanks for the quick response. After creating a custom t-linux-multilib file I encountered the same error as you did, and after looking in issue #1126 you mentioned I've manged to get it build by editing configure and changing glibc_multilib_names and newlib_multilib_names to list my wanted permutations.

If you are building a Linux toolchain then why do you think that you need to change the latter? Newlib has nothing to do with the Linux toolchain.

And it looks like it did build glibc with my permutations (I saw it created folders named "build-glibc-linux-rv64i...") but now when I invoke riscv64-unknown-linux-gnu-gcc -print-multi-lib it's printing only lib64/lp64;@march=rv64imac@mabi=lp64. Now, I'm not sure how to check if it actually built them, and where they are suppose to be in my install folder. Maybe only the print is wrong? and they are actually available?

If -print-multi-lib is not listing your required multilibs then, even if they got built, it sounds like the toolchain knowns nothing about them.

Unfortunately, there seem to be several fundamental problems with building certain multilib toolchains and I don't understand what they are, never mind how to address them. :-(

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Mar 23, 2023

Now, I'm not sure how to check if it actually built them, and where they are suppose to be in my install folder.

For the Linux toolchain multilibs should be in

  • <prefix-directory>/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/lib32
  • <prefix-directory>/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/lib64
  • <prefix-directory>/gcc/riscv64-unknown-linux-gnu/lib32
  • <prefix-directory>/gcc/riscv64-unknown-linux-gnu/lib64

But, as I said, if they're there but -print-multi-lib does not list them then I suspect that the toolchain doesn't know about them.

@TommyMurphyTM1234
Copy link
Collaborator

Any update @amitch1999?

@amitch1999
Copy link
Author

Afraid not, I didn't manage to get those certain multilibs to build, and also not sure how to address that.

@TommyMurphyTM1234
Copy link
Collaborator

My suggestion here for overriding the default set of multilibs seems to be no longer valid:

See here for further background on this:

Instead I took this, arguably slightly hacky, approach:

git clone https://github.com/riscv-collab/riscv-gnu-toolchain issue-1215
cd issue-1215
./configure --prefix=`pwd`/installed-tools --enable-multilib

I then edited the Makefile generated by the configure step to change the default set of multilibs:

GLIBC_MULTILIB_NAMES := rv32imac-ilp32 rv32imafdc-ilp32d rv64imac-lp64 rv64imafdc-lp64d

to this alternative set, appending the bitmanip multilibs to the default set:

GLIBC_MULTILIB_NAMES := rv32imac-ilp32 rv32imafdc-ilp32d rv64imac-lp64 rv64imafdc-lp64d rv64imac_zbs_zbc_zbb_zba-lp64 rv64imafdc_zbs_zbc_zbb_zba-lp64d

and then ran the build:

make linux 2>&1 | tee build.log

./installed-tools/bin/riscv64-unknown-linux-gnu-gcc -dumpspecs

...

*multilib:
. !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib32/ilp32:../lib32/ilp32 march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs mabi=ilp32 !mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib32/ilp32d:../lib32/ilp32d !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib64/lp64:../lib64/lp64 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d mabi=lp64 !mabi=lp64d;lib64/lp64d:../lib64/lp64d !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d !mabi=lp64 mabi=lp64d;lib64/lp64:../lib64/lp64 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d mabi=lp64 !mabi=lp64d;lib64/lp64d:../lib64/lp64d !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d !mabi=lp64 mabi=lp64d;

*multilib_defaults:
march=rv64imafdc_zicsr mabi=lp64d

*multilib_extra:


*multilib_matches:
march=rv32imac march=rv32imac;march=rv32ima march=rv32ima;march=rv32imaf_zicsr march=rv32imaf_zicsr;march=rv32imafc_zicsr march=rv32imafc_zicsr;march=rv32imafd_zicsr march=rv32imafd_zicsr;march=rv32imafdc_zicsr march=rv32imafdc_zicsr;march=rv64imac march=rv64imac;march=rv64ima march=rv64ima;march=rv64imaf_zicsr march=rv64imaf_zicsr;march=rv64imafc_zicsr march=rv64imafc_zicsr;march=rv64imafd_zicsr march=rv64imafd_zicsr;march=rv64imafdc_zicsr march=rv64imafdc_zicsr;march=rv64imac_zba_zbb_zbc_zbs march=rv64imac_zba_zbb_zbc_zbs;march=rv64imafdc_zicsr_zba_zbb_zbc_zbs march=rv64imafdc_zicsr_zba_zbb_zbc_zbs;mabi=ilp32 mabi=ilp32;mabi=ilp32d mabi=ilp32d;mabi=lp64 mabi=lp64;mabi=lp64d mabi=lp64d;

*multilib_exclusions:


*multilib_options:
march=rv32imac/march=rv32ima/march=rv32imaf_zicsr/march=rv32imafc_zicsr/march=rv32imafd_zicsr/march=rv32imafdc_zicsr/march=rv64imac/march=rv64ima/march=rv64imaf_zicsr/march=rv64imafc_zicsr/march=rv64imafd_zicsr/march=rv64imafdc_zicsr/march=rv64imac_zba_zbb_zbc_zbs/march=rv64imafdc_zicsr_zba_zbb_zbc_zbs mabi=ilp32/mabi=ilp32d/mabi=lp64/mabi=lp64d

*multilib_reuse:
lib32/ilp32:../lib32/ilp32 !march=rv32imac march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs mabi=ilp32 !mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib32/ilp32:../lib32/ilp32 !march=rv32imac !march=rv32ima march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs mabi=ilp32 !mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib32/ilp32:../lib32/ilp32 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs mabi=ilp32 !mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib32/ilp32:../lib32/ilp32 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs mabi=ilp32 !mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib32/ilp32:../lib32/ilp32 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs mabi=ilp32 !mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib32/ilp32d:../lib32/ilp32d !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 mabi=ilp32d !mabi=lp64 !mabi=lp64d;lib64/lp64:../lib64/lp64 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d mabi=lp64 !mabi=lp64d;lib64/lp64:../lib64/lp64 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d mabi=lp64 !mabi=lp64d;lib64/lp64:../lib64/lp64 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr march=rv64imafc_zicsr !march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d mabi=lp64 !mabi=lp64d;lib64/lp64:../lib64/lp64 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d mabi=lp64 !mabi=lp64d;lib64/lp64:../lib64/lp64 !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr !march=rv64imafd_zicsr march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d mabi=lp64 !mabi=lp64d;lib64/lp64d:../lib64/lp64d !march=rv32imac !march=rv32ima !march=rv32imaf_zicsr !march=rv32imafc_zicsr !march=rv32imafd_zicsr !march=rv32imafdc_zicsr !march=rv64imac !march=rv64ima !march=rv64imaf_zicsr !march=rv64imafc_zicsr march=rv64imafd_zicsr !march=rv64imafdc_zicsr !march=rv64imac_zba_zbb_zbc_zbs !march=rv64imafdc_zicsr_zba_zbb_zbc_zbs !mabi=ilp32 !mabi=ilp32d !mabi=lp64 mabi=lp64d;

...

So, using this approach, it is possible to build a multilib toolchain with the required bitmanip multilibs in addition to the default base set of multilibs.

I think that there may still be other issues with the way that multilibs are configured/built, but these are separate from the original issue raised here which I consider to be resolved now.

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Oct 17, 2023

Actually, this summarises the multilib capabilities of the resulting toolchain more clearly/concisely.
Rememer that . refers to the toolchain default arch/abi - by default, and in this case, rv64gc/lp64d (also expanded to rv64imafdc_zicsr/lp64d).

./installed-tools/bin/riscv64-unknown-linux-gnu-gcc -print-multi-lib
.;
lib32/ilp32;@march=rv32imac@mabi=ilp32
lib32/ilp32d;@march=rv32imafdc_zicsr@mabi=ilp32d
lib64/lp64;@march=rv64imac@mabi=lp64
lib64/lp64;@march=rv64imac_zba_zbb_zbc_zbs@mabi=lp64
lib64/lp64d;@march=rv64imafdc_zicsr_zba_zbb_zbc_zbs@mabi=lp64d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants