Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Add support for RISCV{32,64} to glibc bindings #2355

Merged
merged 1 commit into from
Nov 22, 2018
Merged

Add support for RISCV{32,64} to glibc bindings #2355

merged 1 commit into from
Nov 22, 2018

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Nov 18, 2018

Tested on riscv-qemu.

function qemu_risv {
  ~/riscv-qemu/build/./riscv64-linux-user/qemu-riscv64 \
    -L /usr/riscv64-linux-gnu \
    -E LD_LIBRARY_PATH=~/gdc/riscv/riscv64-linux-gnu/libgcc $@;
}

for test in $(qemu_risv ./unittest_static); do
  qemu_risv ./unittest_static $test;
done

0.010s PASS release64 core.atomic
0.001s PASS release64 core.bitop
0.001s PASS release64 core.checkedint
0.129s PASS release64 core.demangle
0.002s PASS release64 core.exception
0.031s PASS release64 core.internal.arrayop
0.000s PASS release64 core.internal.hash
0.002s PASS release64 core.internal.parseoptions
0.001s PASS release64 core.internal.string
0.000s PASS release64 core.math
0.004s PASS release64 core.memory
0.000s PASS release64 core.stdc.stdlib
0.027s PASS release64 core.sync.barrier
0.044s PASS release64 core.sync.condition
0.000s PASS release64 core.sync.config
0.028s PASS release64 core.sync.mutex
0.019s PASS release64 core.sync.rwmutex
0.027s PASS release64 core.sync.semaphore
0.258s PASS release64 core.thread
0.105s PASS release64 core.time
0.005s PASS release64 gcc.backtrace
0.024s PASS release64 object
0.003s PASS release64 rt.aApply
0.003s PASS release64 rt.aApplyR
0.002s PASS release64 rt.aaA
0.000s PASS release64 rt.adi
0.000s PASS release64 rt.arrayassign
0.000s PASS release64 rt.arraycast
0.015s PASS release64 rt.lifetime
0.009s PASS release64 rt.minfo
0.000s PASS release64 rt.monitor_
0.000s PASS release64 rt.qsort
0.000s PASS release64 rt.typeinfo.ti_Aint
0.004s PASS release64 rt.util.container.array
0.008s PASS release64 rt.util.container.hashtab
0.438s PASS release64 rt.util.container.treap
0.008s PASS release64 rt.util.utf
0.000s PASS release64 gc.bits
0.436s PASS release64 gc.impl.conservative.gc
0.000s PASS release64 gc.pooltable
0.001s PASS release64 core.sys.posix.stdio
0.000s PASS release64 core.sys.posix.sys.select
0.001s PASS release64 core.sys.linux.stdio
0.000s PASS release64 core.sys.linux.tipc

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + druntime#2355"

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 18, 2018

Fixed up src/core/sys/posix/sys/msg.d, as there is a difference between RISCV32 and RISCV64. However it is the same difference as other targets that mirror the generic libc headers. The different should be D_LP64 instead, which is a potential refactoring.

@thewilsonator
Copy link
Contributor

Please rebase.

@thewilsonator thewilsonator added the Needs Rebase needs a `git rebase` performed label Nov 20, 2018
@dlang-bot dlang-bot removed the Needs Rebase needs a `git rebase` performed label Nov 22, 2018
@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 22, 2018

Rebased.

@thewilsonator
Copy link
Contributor

Thanks.

c_long[12] __regs;
c_long __sp;
static if (__traits(getTargetInfo, "floatAbi") == "double")
double[12] __fpregs;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TurkeyMan - First user of __traits(getTargetInfo) ! (ABI models of RISC-V are "soft", "single", "double", and "quad" https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md#preprocessor-definitions :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! We should support basically everything we can behind getTargetInfo! It's a nice clean tidy and centralised way to get at target info!

@dlang-bot dlang-bot merged commit 0450507 into dlang:master Nov 22, 2018
@ibuclaw ibuclaw deleted the riscv branch November 22, 2018 08:20
kraj pushed a commit to kraj/gcc that referenced this pull request Dec 2, 2018
Backported from upstream druntime master.

Reviewed-on: dlang/druntime#2355

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266713 138bc75d-0d04-0410-961f-82ee72b054a4
asiekierka pushed a commit to WonderfulToolchain/gcc-ia16 that referenced this pull request May 16, 2022
Backported from upstream druntime master.

Reviewed-on: dlang/druntime#2355

From-SVN: r266713
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants