FreeBSD current on ppc64 and RISC-V rv64imafdc
Dennis Clarke
dclarke at blastwave.org
Tue Jul 16 02:38:50 UTC 2019
On 7/15/19 8:38 PM, Mark Linimon wrote:
> On Mon, Jul 15, 2019 at 08:29:06PM -0400, Dennis Clarke wrote:
>> Essentially one may checkout the sources and do a clean build only to
>> see the kernel panic on ppc64 hardware.
>
> I don't understand. What hardware?
PowerMac G5 quad however things just got a *lot* better today :
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238730
>
> We are doing a lot of work on Power8 and Power9 hardware from various
> manufacturers, and both 12 and -CURRENT behave well, even under stress.
I am so very happy to hear that. I would like to see IBM Power be a
tier-1 as would many others I am sure. Perhaps not Red Hat. Then again
who knows.
> (I have powered down my Power5 machine; I know of two cases where I
> cannot move to 12.X, and since I have Power9 in-house, I probably will
> not pursue it.)
It is best to stick in the Power8 land and upwards. Those of us still
messing with the old PowerMac G5 with its IBM 970MP processors are going
to be around for a long time yet. Given that FreeBSD runs there.
>> Strangely I have [a RISC-V] instance that boots neatly inside a qemu
>> vm and that even includes a ZFS zpool.
>
> If you've built ports on it, you may be the first. You are definitely
> at the bleeding edge in this case. I know of no user documentation for
> FreeBSD/RISC-V.
I know. There really is not much and everything has to be looked at
carefully in the smallest details. However I have an 8-way smp RISC-V
qemu vm running or at least walking :
bbl loader
---<<BOOT>>---
KDB: debugger backends: ddb
KDB: current backend: ddb
Found 8 CPUs in the device tree
Copyright (c) 1992-2019 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.0-CURRENT r348983 QEMU riscv
gcc version 8.1.0 (FreeBSD Ports Collection for riscv64)
WARNING: WITNESS option enabled, expect reduced performance.
Preloaded elf64 kernel "kernel" at 0xffffffc0007ce840.
CPU(0): Unknown Implementer Unknown Processor
real memory = 8588886016 (8191 MB)
Physical memory chunk(s):
0x0000000080a2f000 - 0x0000000080bfffff, 1904640 bytes (465 pages)
0x0000000080d00000 - 0x00000002731e7fff, 8360198144 bytes (2041064 pages)
avail memory = 8328466432 (7942 MB)
Starting CPU 4 (hart 0)
Starting CPU 5 (hart 1)
Starting CPU 6 (hart 2)
Starting CPU 7 (hart 3)
Starting CPU 1 (hart 5)
Starting CPU 2 (hart 6)
Starting CPU 3 (hart 7)
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
arc4random: WARNING: initial seeding bypassed the cryptographic random
device because it was not yet seeded and the knob
'bypass_before_seeding' was enabled.
VIMAGE (virtualized network stack) enabled
ULE: setup cpu 0
ULE: setup cpu 1
ULE: setup cpu 2
ULE: setup cpu 3
ULE: setup cpu 4
ULE: setup cpu 5
ULE: setup cpu 6
ULE: setup cpu 7
random: entropy device external interface
null: <full device, null device, zero device>
nfslock: pseudo-device
openfirm: <Open Firmware control device>
mem: <memory>
crypto: <crypto core>
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
plic0: <RISC-V PLIC> mem 0xc000000-0xfffffff irq
9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 on simplebus0
timer0: <RISC-V Timer>
Timecounter "RISC-V Timecounter" frequency 10000000 Hz quality 1000
Event timer "RISC-V Eventtimer" frequency 10000000 Hz quality 1000
rcons0: <RISC-V console>
ofwbus0: no default resources for rid = 0, type = 4
ofwbus0: no default resources for rid = 0, type = 4
ofwbus0: no default resources for rid = 0, type = 4
uart0: <16550 or compatible> mem 0x10000000-0x100000ff irq 0 on ofwbus0
uart0: console (76800,n,8,1)
uart0: fast interrupt
uart0: PPS capture mode: DCD
ofwbus0: <test at 100000> mem 0x100000-0x100fff compat sifive,test0 (no
driver attached)
virtio_mmio0: <VirtIO MMIO adapter> mem 0x10008000-0x10008fff irq 1 on
ofwbus0
virtio_mmio1: <VirtIO MMIO adapter> mem 0x10007000-0x10007fff irq 2 on
ofwbus0
vtblk0: <VirtIO Block Adapter> on virtio_mmio1
virtio_mmio1: host features: 0x31000ed4
<EventIdx,RingIndirect,NotifyOnEmpty,ConfigWCE,Topology,WriteCache,SCSICmds,BlockSize,DiskGeometry,MaxNumSegs>
virtio_mmio1: negotiated features: 0x10000e54
<RingIndirect,ConfigWCE,Topology,WriteCache,BlockSize,DiskGeometry,MaxNumSegs>
vtblk0: 32768MB (67108864 512 byte sectors)
virtio_mmio2: <VirtIO MMIO adapter> mem 0x10006000-0x10006fff irq 3 on
ofwbus0
vtblk1: <VirtIO Block Adapter> on virtio_mmio2
virtio_mmio2: host features: 0x31000ed4
<EventIdx,RingIndirect,NotifyOnEmpty,ConfigWCE,Topology,WriteCache,SCSICmds,BlockSize,DiskGeometry,MaxNumSegs>
virtio_mmio2: negotiated features: 0x10000e54
<RingIndirect,ConfigWCE,Topology,WriteCache,BlockSize,DiskGeometry,MaxNumSegs>
vtblk1: 4096MB (8390400 512 byte sectors)
virtio_mmio3: <VirtIO MMIO adapter> mem 0x10005000-0x10005fff irq 4 on
ofwbus0
vtblk2: <VirtIO Block Adapter> on virtio_mmio3
virtio_mmio3: host features: 0x31000ed4
<EventIdx,RingIndirect,NotifyOnEmpty,ConfigWCE,Topology,WriteCache,SCSICmds,BlockSize,DiskGeometry,MaxNumSegs>
virtio_mmio3: negotiated features: 0x10000e54
<RingIndirect,ConfigWCE,Topology,WriteCache,BlockSize,DiskGeometry,MaxNumSegs>
vtblk2: 4096MB (8390400 512 byte sectors)
virtio_mmio4: <VirtIO MMIO adapter> mem 0x10004000-0x10004fff irq 5 on
ofwbus0
vtblk3: <VirtIO Block Adapter> on virtio_mmio4
virtio_mmio4: host features: 0x31000ed4
<EventIdx,RingIndirect,NotifyOnEmpty,ConfigWCE,Topology,WriteCache,SCSICmds,BlockSize,DiskGeometry,MaxNumSegs>
virtio_mmio4: negotiated features: 0x10000e54
<RingIndirect,ConfigWCE,Topology,WriteCache,BlockSize,DiskGeometry,MaxNumSegs>
vtblk3: 4096MB (8390400 512 byte sectors)
virtio_mmio5: <VirtIO MMIO adapter> mem 0x10003000-0x10003fff irq 6 on
ofwbus0
vtnet0: <VirtIO Networking Adapter> on virtio_mmio5
virtio_mmio5: host features: 0x39bf8064
<EventIdx,RingIndirect,0x8000000,NotifyOnEmpty,SetMacAddress,GuestAnnounce,RxModeExtra,VLanFilter,RxMode,ControlVq,Status,MrgRxBuf,TxAllGSO,MacAddress,0x4>
virtio_mmio5: negotiated features: 0x308f8060
<EventIdx,RingIndirect,SetMacAddress,VLanFilter,RxMode,ControlVq,Status,MrgRxBuf,TxAllGSO,MacAddress>
vtnet0: bpf attached
vtnet0: Ethernet address: 52:54:00:12:34:56
virtio_mmio6: <VirtIO MMIO adapter> mem 0x10002000-0x10002fff irq 7 on
ofwbus0
virtio_mmio7: <VirtIO MMIO adapter> mem 0x10001000-0x10001fff irq 8 on
ofwbus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cpu0: Nominal frequency 1000Mhz
riscv64_cpu0: register <0>
cpu1: <Open Firmware CPU> on cpulist0
cpu1: Nominal frequency 1000Mhz
riscv64_cpu1: register <1>
cpu2: <Open Firmware CPU> on cpulist0
cpu2: Nominal frequency 1000Mhz
riscv64_cpu2: register <2>
cpu3: <Open Firmware CPU> on cpulist0
cpu3: Nominal frequency 1000Mhz
riscv64_cpu3: register <3>
cpu4: <Open Firmware CPU> on cpulist0
cpu4: Nominal frequency 1000Mhz
riscv64_cpu4: register <4>
cpu5: <Open Firmware CPU> on cpulist0
cpu5: Nominal frequency 1000Mhz
riscv64_cpu5: register <5>
cpu6: <Open Firmware CPU> on cpulist0
cpu6: Nominal frequency 1000Mhz
riscv64_cpu6: register <6>
cpu7: <Open Firmware CPU> on cpulist0
cpu7: Nominal frequency 1000Mhz
riscv64_cpu7: register <7>
cryptosoft0: <software crypto>
crypto: assign cryptosoft0 driver id 0, flags 0x6000000
crypto: cryptosoft0 registers alg 1 flags 0 maxoplen 0
.
.
.
Device configuration finished.
procfs registered
Timecounters tick every 10.000 msec
vlan: initialized, using hash tables with chaining
lo0: bpf attached
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 65536
IPsec: Initialized Security Association Processing.
GEOM: new disk vtbd0
GEOM: new disk vtbd1
GEOM: new disk vtbd2
GEOM: new disk vtbd3
Release APs
CPU(1): Unknown Implementer Unknown Processor
CPU(2): Unknown Implementer Unknown Processor
CPU(3): Unknown Implementer Unknown Processor
CPU(7): Unknown Implementer Unknown Processor
CPU(4): Unknown Implementer Unknown Processor
CPU(5): Unknown Implementer Unknown Processor
CPU(6): Unknown Implementer Unknown Processor
WARNING: WITNESS option enabled, expect reduced performance.
Trying to mount root from ufs:/dev/vtbd0 []...
WARNING: / was not properly dismounted
Warning: no time-of-day clock registered, system time will not be set
accurately
start_init: trying /sbin/init
Setting hostuuid: 96d5bdc1-8d93-11e9-9a83-1502ebf1fac6.
Setting hostid: 0xc77cd316.
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
.
.
.
Setting hostuuid: 96d5bdc1-8d93-11e9-9a83-1502ebf1fac6.
Setting hostid: 0xc77cd316.
No suitable dump device was found.
Fast boot: skipping disk checks.
Mounting local filesystems:.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib
ldconfig: /usr/local/lib: ignoring directory not owned by root
Setting hostname: ganymede.
Setting up harvesting:
[UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: .
lo0: link state changed to UP
vtnet0: link state changed to UP
Starting Network: lo0 vtnet0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
ether 52:54:00:12:34:56
inet 172.16.35.6 netmask 0xffffffc0 broadcast 172.16.35.63
media: Ethernet 10Gbase-T <full-duplex>
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 172.16.35.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Creating and/or trimming log files.
Starting syslogd.
Clearing /tmp.
Updating motd:.
Mounting late filesystems:.
Performing sanity check on sshd configuration.
Starting sshd.
Starting sendmail.
Starting sendmail_msp_queue.
Starting cron.
Jul 16 01:40:06 ganymede sm-msp-queue[612]: x5E4t2I2000849:
SYSERR(root): timeout writing message to [127.0.0.1]
Starting background file system checks in 60 seconds.
Tue Jul 16 01:40:10 UTC 2019
FreeBSD/riscv (ganymede) (ttyu0)
login: root
Jul 16 01:40:18 ganymede login[663]: ROOT LOGIN (root) ON ttyu0
Last login: Fri Jun 14 03:57:55 on ttyu0
FreeBSD 13.0-CURRENT r348983 QEMU
+---------------------------------------------------------------------+
|FreeBSD ganymede 13.0-CURRENT r348983 RISC-V rv64imafdc |
+---------------------------------------------------------------------+
| |
| * * * W A R N I N G * * * |
| |
| Property of |
| |
| #### ###### # # # # # # ##### # # |
| # # # ## # # # ## # # # # |
| # ##### # # # # # # # # # ## |
| # ### # # # # # # # # # # ## |
| # # # # ## # # # ## # # # |
| #### ###### # # #### # # ##### # # |
| |
| If you are not authorized to access this system, disconnect now. |
| Users of this system have no expectation of privacy. By continuing, |
| you consent to your keystrokes and data content being monitored. |
| |
+---------------------------------------------------------------------+
Welcome to FreeBSD!
.
.
.
ganymede#
ganymede# ls bin
dn zl
ganymede#
ganymede# bin/zl
NAME USED AVAIL EX DV CKS CMP
RATIO QUOTA SNAP MNT MOUNTPOINT
rv64imafdc 1.06G 2.57G on off sha256 on
2.45x none 0 no none
rv64imafdc/ports 183M 2.57G on on sha256 lz4
2.30x none 0 yes /usr/ports
rv64imafdc/z 862M 1.16G off off sha256 on
2.50x 2G 0 yes /z
rv64imafdc/z/000 861M 163M on off sha256 on
2.50x 1G 17.0M yes /z/000
rv64imafdc/z/001 47K 1024M on off sha256 on
1.26x 1G 13K yes /z/001
rv64imafdc/z/002 868K 1023M on off sha256 on
2.54x 1G 0 yes /z/002
ganymede#
ganymede# zpool status
pool: rv64imafdc
state: ONLINE
scan: scrub repaired 0 in 0 days 00:27:04 with 0 errors on Fri Jun 14
04:30:36 2019
config:
NAME STATE READ WRITE CKSUM
rv64imafdc ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
vtbd1 ONLINE 0 0 0
vtbd2 ONLINE 0 0 0
spares
vtbd3 AVAIL
errors: No known data errors
ganymede#
ganymede# zpool scrub rv64imafdc
ganymede# Jul 16 02:00:04 ganymede sendmail[762]: x6G202Uh000762:
SYSERR(operator): timeout writing message to [127.0.0.1]
ganymede# zpool status
pool: rv64imafdc
state: ONLINE
scan: scrub in progress since Tue Jul 16 01:58:24 2019
1.06G scanned at 3.33M/s, 1.71M issued at 5.38K/s, 1.06G total
0 repaired, 0.16% done, no estimated completion time
config:
NAME STATE READ WRITE CKSUM
rv64imafdc ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
vtbd1 ONLINE 0 0 0
vtbd2 ONLINE 0 0 0
spares
vtbd3 AVAIL
errors: No known data errors
ganymede#
ganymede# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rv64imafdc 1.06G 2.57G 23K none
rv64imafdc/ports 183M 2.57G 183M /usr/ports
rv64imafdc/z 862M 1.16G 23K /z
rv64imafdc/z/000 861M 163M 844M /z/000
rv64imafdc/z/001 47K 1024M 34K /z/001
rv64imafdc/z/002 868K 1023M 868K /z/002
ganymede#
ganymede# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
rv64imafdc/z/000 at 20190523135048 13K - 23K -
rv64imafdc/z/000 at 20190523141917 17.0M - 861M -
rv64imafdc/z/001 at 20190523135048 13K - 23K -
ganymede#
.
.
.
ganymede# sysctl -a | grep 'smp'
kern.smp.maxid: 7
kern.smp.maxcpus: 16
kern.smp.active: 1
kern.smp.disabled: 0
kern.smp.cpus: 8
kern.smp.threads_per_core: 1
kern.smp.cores: 8
kern.smp.topology: 0
kern.smp.forward_signal_enabled: 1
"zfs","crossmp"
"devfs","crossmp"
"entropy harvest mutex","smp rendezvous"
ganymede#
ganymede# which dn
/root/bin/dn
ganymede# cat /root/bin/dn
#!/bin/sh
TZ=GMT0;export TZ
LC_TIME=C;export LC_TIME
/bin/date '+%Y%m%d%H%M%S'
ganymede#
ganymede# dn
20190716020810
ganymede#
As an ordinary user all seems fine until I try to use the linker :
ganymede$
ganymede$ head foo.c
/* taken directly from
http://www.cse.psu.edu/~dheller/cmpsc311/sp13/Projects/Project-1/pr1.1.c */
#include <stdio.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <complex.h>
#include <time.h>
ganymede$
ganymede$ CC=/usr/local/bin/gcc ; export CC
ganymede$
ganymede$ $CC --version
gcc (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ganymede$
ganymede$ $CC -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/lto-wrapper
Target: riscv64-unknown-freebsd12.0
Configured with:
/home/br/dev/riscv20181213/riscv-gnu-toolchain/riscv-gcc/configure
--target=riscv64-unknown-freebsd12.0 --host=riscv64-unknown-freebsd12.0
--with-build-sysroot=/home/br/riscv-world --without-newlib
--without-headers --disable-werror --disable-shared --enable-threads
--enable-tls --enable-languages=c,c++
--with-gmp=/home/br/riscv-world/usr/local
--with-mpfr=/home/br/riscv-world/usr/local
--with-mpc=/home/br/riscv-world/usr/local --disable-libatomic
--disable-libmudflap --disable-libssp --disable-libquadmath
--disable-libgomp --disable-nls --disable-bootstrap --disable-multilib
--with-arch=rv64imafdc
Thread model: posix
gcc version 8.2.0 (GCC)
ganymede$
ganymede$ $CC -v -std=iso9899:1999 -pedantic -pedantic-errors \
> -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d \
> -mpreferred-stack-boundary=4 -mstrict-align \
> -mexplicit-relocs -S -o foo.s foo.c
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gcc
Target: riscv64-unknown-freebsd12.0
Configured with:
/home/br/dev/riscv20181213/riscv-gnu-toolchain/riscv-gcc/configure
--target=riscv64-unknown-freebsd12.0 --host=riscv64-unknown-freebsd12.0
--with-build-sysroot=/home/br/riscv-world --without-newlib
--without-headers --disable-werror --disable-shared --enable-threads
--enable-tls --enable-languages=c,c++
--with-gmp=/home/br/riscv-world/usr/local
--with-mpfr=/home/br/riscv-world/usr/local
--with-mpc=/home/br/riscv-world/usr/local --disable-libatomic
--disable-libmudflap --disable-libssp --disable-libquadmath
--disable-libgomp --disable-nls --disable-bootstrap --disable-multilib
--with-arch=rv64imafdc
Thread model: posix
gcc version 8.2.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-std=c99' '-Wpedantic' '-pedantic-errors'
'-O0' '-fno-builtin' '-march=rv64imafdc' '-mabi=lp64d'
'-mpreferred-stack-boundary=4' '-mstrict-align' '-mexplicit-relocs' '-S'
'-o' 'foo.s'
/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/cc1 -quiet -v
foo.c -quiet -dumpbase foo.c -march=rv64imafdc -mabi=lp64d
-mpreferred-stack-boundary=4 -mstrict-align -mexplicit-relocs
-auxbase-strip foo.s -O0 -Wpedantic -pedantic-errors -std=c99 -version
-fno-builtin -o foo.s
GNU C99 (GCC) version 8.2.0 (riscv64-unknown-freebsd12.0)
compiled by GNU C version 8.2.0, GMP version 6.1.2, MPFR
version 4.0.1, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/include
/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/include-fixed
/usr/include
End of search list.
GNU C99 (GCC) version 8.2.0 (riscv64-unknown-freebsd12.0)
compiled by GNU C version 8.2.0, GMP version 6.1.2, MPFR
version 4.0.1, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 4dda19917b6f288652be2776fcfdf247
COMPILER_PATH=/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/
LIBRARY_PATH=/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/lib/:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-std=c99' '-Wpedantic' '-pedantic-errors'
'-O0' '-fno-builtin' '-march=rv64imafdc' '-mabi=lp64d'
'-mpreferred-stack-boundary=4' '-mstrict-align' '-mexplicit-relocs' '-S'
'-o' 'foo.s'
ganymede$
ganymede$ $CC -v -std=iso9899:1999 -pedantic -pedantic-errors \
> -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d \
> -mpreferred-stack-boundary=4 -mstrict-align \
> -mexplicit-relocs -c -o foo.o foo.s
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gcc
Target: riscv64-unknown-freebsd12.0
Configured with:
/home/br/dev/riscv20181213/riscv-gnu-toolchain/riscv-gcc/configure
--target=riscv64-unknown-freebsd12.0 --host=riscv64-unknown-freebsd12.0
--with-build-sysroot=/home/br/riscv-world --without-newlib
--without-headers --disable-werror --disable-shared --enable-threads
--enable-tls --enable-languages=c,c++
--with-gmp=/home/br/riscv-world/usr/local
--with-mpfr=/home/br/riscv-world/usr/local
--with-mpc=/home/br/riscv-world/usr/local --disable-libatomic
--disable-libmudflap --disable-libssp --disable-libquadmath
--disable-libgomp --disable-nls --disable-bootstrap --disable-multilib
--with-arch=rv64imafdc
Thread model: posix
gcc version 8.2.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-std=c99' '-Wpedantic' '-pedantic-errors'
'-O0' '-fno-builtin' '-march=rv64imafdc' '-mabi=lp64d'
'-mpreferred-stack-boundary=4' '-mstrict-align' '-mexplicit-relocs' '-c'
'-o' 'foo.o'
/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/as
-v --traditional-format -march=rv64imafdc -mabi=lp64d -o foo.o foo.s
GNU assembler version 2.31.1 (riscv64-unknown-freebsd12.0) using BFD
version (GNU Binutils) 2.31.1
COMPILER_PATH=/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/
LIBRARY_PATH=/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/lib/:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-std=c99' '-Wpedantic' '-pedantic-errors'
'-O0' '-fno-builtin' '-march=rv64imafdc' '-mabi=lp64d'
'-mpreferred-stack-boundary=4' '-mstrict-align' '-mexplicit-relocs' '-c'
'-o' 'foo.o'
ganymede$
ganymede$ $CC -v -std=iso9899:1999 -pedantic -pedantic-errors \
> -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d \
> -mpreferred-stack-boundary=4 -mstrict-align \
> -mexplicit-relocs -o foo foo.o
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/lto-wrapper
Target: riscv64-unknown-freebsd12.0
Configured with:
/home/br/dev/riscv20181213/riscv-gnu-toolchain/riscv-gcc/configure
--target=riscv64-unknown-freebsd12.0 --host=riscv64-unknown-freebsd12.0
--with-build-sysroot=/home/br/riscv-world --without-newlib
--without-headers --disable-werror --disable-shared --enable-threads
--enable-tls --enable-languages=c,c++
--with-gmp=/home/br/riscv-world/usr/local
--with-mpfr=/home/br/riscv-world/usr/local
--with-mpc=/home/br/riscv-world/usr/local --disable-libatomic
--disable-libmudflap --disable-libssp --disable-libquadmath
--disable-libgomp --disable-nls --disable-bootstrap --disable-multilib
--with-arch=rv64imafdc
Thread model: posix
gcc version 8.2.0 (GCC)
COMPILER_PATH=/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/
LIBRARY_PATH=/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/lib/:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-std=c99' '-Wpedantic' '-pedantic-errors'
'-O0' '-fno-builtin' '-march=rv64imafdc' '-mabi=lp64d'
'-mpreferred-stack-boundary=4' '-mstrict-align' '-mexplicit-relocs' '-o'
'foo'
/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/collect2
-plugin
/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/liblto_plugin.so
-plugin-opt=/usr/local/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/lto-wrapper
-plugin-opt=-fresolution=/var/tmp/dclarke/cctol3UB.res
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc --eh-frame-hdr -melf64lriscv -V
-dynamic-linker /libexec/ld-elf.so.1 -o foo /usr/lib/crt1.o
/usr/lib/crti.o /usr/lib/crtbegin.o
-L/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0
-L/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/lib
foo.o -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
GNU ld (GNU Binutils) 2.31.1
Supported emulations:
elf64lriscv
elf32lriscv
/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/ld:
cannot find -lgcc
/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/ld:
cannot find -lc
/usr/local/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/ld:
cannot find -lgcc
collect2: error: ld returned 1 exit status
ganymede$
* * * really ?? * * *
ganymede$ ls -lap
total 68
drwxr-xr-x 2 dclarke devl 512 Jul 16 02:30 ./
drwxr-xr-x 3 dclarke devl 512 Jul 16 02:16 ../
-rw-r--r-- 1 dclarke devl 5133 Jul 16 02:23 foo.c
-rw-r--r-- 1 dclarke devl 33472 Jul 16 02:30 foo.o
-rw-r--r-- 1 dclarke devl 16151 Jul 16 02:29 foo.s
ganymede$
ganymede$ file foo.o
foo.o: ELF 64-bit LSB relocatable, UCB RISC-V, version 1 (SYSV), not
stripped
ganymede$
I have no idea why ld can not locate libgcc.so.X and would love some
insights on that from anyone.
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
More information about the freebsd-ppc
mailing list