Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Raspberry Pi 3 - 64 Bit Operation
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Sun Mar 27, 2016 2:17 pm    Post subject: Raspberry Pi 3 - 64 Bit Operation Reply with quote

Team,

I'm trying to get a Raspberry Pi 3 to work in 64 bit mode. I've got lots of bits to put together, including some userspace things in a cross root.
So far I have
    a 3.3v USB to serial 'dofer'
    a 64 bit Pi3 uboot
    a 64 bit Pi3 kernel
The idea being that uboot leaves the Pi in the right privilege level for the kernel to run and hands over to the kernel.
I get to interact with the Pi using minicom because thats about all that works in 64 bit mode so far.

I'm building as much userspace as possible with a cross dev toolchain. However one of the key packages - gcc fails.
The build log finishes with
Code:
 /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../libbacktrace/.libs/libbacktrace.a(state.o): Relocations in generic ELF (EM: 183)
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../libbacktrace/.libs/libbacktrace.a(state.o): Relocations in generic ELF (EM: 183)
../libbacktrace/.libs/libbacktrace.a: error adding symbols: File in wrong format
so its clearly using the wrong linker, which is then choking on an aarch64 ELF.

aarch64-armv8a-linux-gnueabi-emerge --info =sys-devel/gcc-5.3.0::gentoo
Build log
aarch64-armv8a-linux-gnueabi-emerge -pqv =sys-devel/gcc-5.3.0::gentoo

A pointer or two would be very welcome
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Sun Mar 27, 2016 2:38 pm    Post subject: Reply with quote

Could you provide the kernel config and the uboot?

I would try to get a RPi3 buildroot image. There is nearly perfect cross compile support in it. With that staging point in 64 bit aarch userland we could get a 64bit gcc on gentoo ;)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Sun Mar 27, 2016 3:10 pm    Post subject: Reply with quote

schorsch_76,

I'm following the instructions on the Raspberry pi forum.
I've just found that there is a gotcha or two with the serial console too.
Serial was ever thus :) It may not matter in 64 bit mode though.

As I say, I've only built stuff so far. I've not actually tested anything yet.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Sun Mar 27, 2016 6:30 pm    Post subject: Reply with quote

I git now the 64 bit kernel booting following the mentioned thread in the raspberry forum. But it still panics because of no userland ;) Now i try to setup the buildroot image with an gcc in it. Video and audio is not yet working. All over serial line ;)

Code:
U-Boot> boot
reading bcm2837-rpi-3-b.dtb
5126 bytes read in 70 ms (71.3 KiB/s)
reading image
8786944 bytes read in 3444 ms (2.4 MiB/s)
## Flattened Device Tree blob at 00000100
   Booting using the fdt blob at 0x000100
   Loading Device Tree to 000000003ab37000, end 000000003ab3b405 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.5.0+ (georg@hammerhead) (gcc version 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP PREEMPT Sun Mar 27 19:44:14 CEST 2016
Boot CPU: AArch64 Processor [410fd034]
efi: Getting EFI parameters from FDT:
efi: UEFI not found.
cma: Reserved 16 MiB at 0x0000000039800000
/cpus/cpu@1: missing enable-method property
/cpus/cpu@2: missing enable-method property
/cpus/cpu@3: missing enable-method property
PERCPU: Embedded 20 pages/cpu @ffffffc03afda000 s41472 r8192 d32256 u81920
Detected VIPT I-cache on CPU0
CPU features: enabling workaround for ARM erratum 845719
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 237888
Kernel command line: dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
PID hash table entries: 4096 (order: 3, 32768 bytes)
Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
software IO TLB [mem 0x34a00000-0x38a00000] (64MB) mapped at [ffffffc034a00000-ffffffc0389fffff]
Memory: 857380K/966656K available (5670K kernel code, 401K rwdata, 2140K rodata, 360K init, 219K bss, 92892K reserved, 16384K cma-reserved)
Virtual kernel memory layout:
    vmalloc : 0xffffff8000000000 - 0xffffffbdbfff0000   (   246 GB)
    vmemmap : 0xffffffbdc0000000 - 0xffffffbfc0000000   (     8 GB maximum)
              0xffffffbdc0000000 - 0xffffffbdc0ec0000   (    14 MB actual)
    fixed   : 0xffffffbffa7fd000 - 0xffffffbffac00000   (  4108 KB)
    PCI I/O : 0xffffffbffae00000 - 0xffffffbffbe00000   (    16 MB)
    modules : 0xffffffbffc000000 - 0xffffffc000000000   (    64 MB)
    memory  : 0xffffffc000000000 - 0xffffffc03b000000   (   944 MB)
      .init : 0xffffffc000823000 - 0xffffffc00087d000   (   360 KB)
      .text : 0xffffffc000080000 - 0xffffffc000822b94   (  7819 KB)
      .data : 0xffffffc00087d000 - 0xffffffc0008e1400   (   401 KB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
        Build-time adjustment of leaf fanout to 64.
        RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=1.
RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=1
NR_IRQS:64 nr_irqs:64 0
sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
bcm2835: system timer (irq = 35)
Architected cp15 timer(s) running at 19.20MHz (phys).
clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
Console: colour dummy device 80x25
Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=76800)
pid_max: default: 32768 minimum: 301
Security Framework initialized
Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
ASID allocator initialised with 65536 entries
EFI services will not be available.
Brought up 1 CPUs
SMP: Total of 1 processors activated.
CPU: All CPU(s) started at EL2
alternatives: patching kernel code
devtmpfs: initialized
DMI not present or invalid.
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
cpuidle: using governor ladder
cpuidle: using governor menu
vdso: 2 pages (1 code @ ffffffc000885000, 1 data @ ffffffc000884000)
hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
DMA: preallocated 256 KiB pool for atomic allocations
Serial: AMBA PL011 UART driver
HugeTLB registered 2 MB page size, pre-allocated 0 pages
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
dmi: Firmware registration failed.
clocksource: Switched to clocksource arch_sys_counter
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
FS-Cache: Loaded
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
kvm [1]: error: no compatible GIC node found
kvm [1]: timer IRQ4
kvm [1]: 8-bit VMID
kvm [1]: Hyp mode initialized successfully
futex hash table entries: 256 (order: 3, 32768 bytes)
audit: initializing netlink subsys (disabled)
audit: type=2000 audit(0.139:1): initialized
FS-Cache: Netfs 'nfs' registered for caching
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
fuse init (API version 7.24)
9p: Installing v9fs 9p2000 file system support
io scheduler noop registered
io scheduler deadline registered (default)
io scheduler cfq registered
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
Unable to detect cache hierarchy from DT for CPU 0
loop: module loaded
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
usbcore: registered new interface driver smsc95xx
3f980000.usb supply vusb_d not found, using dummy regulator
3f980000.usb supply vusb_a not found, using dummy regulator
dwc2 3f980000.usb: Configuration mismatch. dr_mode forced to host
dwc2 3f980000.usb: DWC OTG Controller
dwc2 3f980000.usb: new USB bus registered, assigned bus number 1
dwc2 3f980000.usb: irq 41, io mem 0x00000000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ehci-platform: EHCI generic platform driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-pci: OHCI PCI platform driver
ohci-platform: OHCI generic platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
Synopsys Designware Multimedia Card Interface Driver
sdhci-pltfm: SDHCI platform and OF driver helper
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 17
9pnet: Installing 9P2000 support
Key type dns_resolver registered
Registered cp15_barrier emulation handler
Registered setend emulation handler
registered taskstats version 1
3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 72, base_baud = 0) is a PL011 rev2
usb 1-1: new high-speed USB device number 2 using dwc2
usb 1-1: device descriptor read/all, error -61
console [ttyAMA0] enabled
mmc0: SDHCI controller on 3f300000.sdhci [3f300000.sdhci] using PIO
hctosys: unable to open rtc device (rtc0)
uart-pl011 3f201000.uart: no DMA platform data
Waiting for root device /dev/mmcblk0p2...
mmc0: new SD card at address 0002
mmcblk0: mmc0:0002 00000 1.87 GiB
 mmcblk0: p1
usb 1-1: new high-speed USB device number 3 using dwc2
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -6
Please append a correct "root=" boot option; here are the available partitions:
b300         1955840 mmcblk0  driver: mmcblk
  b301          131072 mmcblk0p1 00000000-01
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.5.0+ #1
Hardware name: Raspberry Pi 3 Model B (DT)
Call trace:
[<ffffffc000089888>] dump_backtrace+0x0/0x1a8
[<ffffffc000089a44>] show_stack+0x14/0x20
[<ffffffc000349a0c>] dump_stack+0x94/0xb8
[<ffffffc00014e4ec>] panic+0x10c/0x250
[<ffffffc000823f2c>] mount_block_root+0x1b0/0x28c
[<ffffffc000824120>] mount_root+0x118/0x130
[<ffffffc000824274>] prepare_namespace+0x13c/0x184
[<ffffffc000823b3c>] kernel_init_freeable+0x1c8/0x1ec
[<ffffffc0005f7910>] kernel_init+0x10/0xe0
[<ffffffc000085cd0>] ret_from_fork+0x10/0x40
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)
usb 1-1: device descriptor read/all, error -61
usb 1-1: new high-speed USB device number 4 using dwc2
usb 1-1: device descriptor read/8, error -71
usb 1-1: device descriptor read/8, error -71
usb 1-1: new high-speed USB device number 5 using dwc2
usb 1-1: device descriptor read/8, error -71
usb 1-1: device descriptor read/8, error -71
usb usb1-port1: unable to enumerate USB device



Not bad .... ;)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Sun Mar 27, 2016 9:45 pm    Post subject: Reply with quote

schorsch_76,

Well done. I only get as far as
Code:
U-Boot> fatload mmc 0:1 0x100 bcm2837-rpi-3-b.dtb
reading bcm2837-rpi-3-b.dtb
5126 bytes read in 42 ms (119.1 KiB/s)
U-Boot> fatload mmc 0:1 0x2000000 image         
reading image
8786944 bytes read in 2496 ms (3.4 MiB/s)
U-Boot> booti 0x2000000

Starting kernel ...
Then nothing.
I guess the kernel doesn't go to 0x2000000 or is not self relocating.

It didn't help that I mounted the SD card as -t msdos, rather than -t vfat. My bcm2837-rpi-3-b.dtb vanished so I was using the wrong file.

How do you get to use
Code:
U-Boot> boot
Do you pack your kernel and dts files together with mkimage?
What command do you use.

Its encouraging that we both have the same size files.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Sun Mar 27, 2016 9:56 pm    Post subject: Reply with quote

So, i got the buildroot userland running :)

Code:
Welcome to Buildroot
buildroot login: root
# ls
# cat /proc/cmdline
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
# cat /proc/version
Linux version 4.5.0+ (georg@hammerhead) (gcc version 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP PREEMPT Sun Mar 27 19:44:14 CEST 2016
# cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 38.40
Features        : fp asimd evtstrm crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4


@Neddy: I guess you need the right patched u-boot version:
I used:
Code:
georg@hammerhead ~/intern/Dokumente/Entwicklung/rpi3/src/u-boot-rpi3 $ git remote -vv
origin   https://github.com/zeldin/u-boot-rpi3.git (fetch)
origin   https://github.com/zeldin/u-boot-rpi3.git (push)

commit 96a6c2f7ad51d7141e2e56966871d097f3ea0bad
Author: Marcus Comstedt <marcus@mc.pp.se>
Date:   Sun Mar 13 01:00:36 2016 +0100

    Add support for Raspberry Pi 3 in 64-bit mode

and this kernel:
rpi3   https://github.com/zeldin/linux.git
commit 60c29c20d7ecc521ccf1ffe1fd58faf55bb926b4
Author: Marcus Comstedt <marcus@mc.pp.se>
Date:   Sun Mar 20 13:09:29 2016 +0100

    arm64: Update the defconfig for RPi3



This command line to get the tty:
Code:
# cat /proc/cmdline
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Sun Mar 27, 2016 9:58 pm    Post subject: Reply with quote

My uboot environment is:

Code:
U-Boot 2016.03-rc3-g96a6c2f-dirty (Mar 27 2016 - 19:14:26 +0200)

DRAM:  944 MiB
RPI: Board rev 0x8 unknown
RPI Unknown model (0xa02082)
MMC:   bcm2835_sdhci: 0
reading uboot.env
In:    serial
Out:   lcd
Err:   lcd
Net:   Net Initialization Skipped
No ethernet found.
starting USB...
USB0:   Core Release: 2.80a
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
       scanning usb for ethernet devices...
Error: sms0 address not set.
Warning: failed to set MAC address
1 Ethernet Device(s) found
Hit any key to stop autoboot:  0
U-Boot> printenv
arch=arm
baudrate=115200
board=rpi_3
board_name=Unknown model
board_rev=0x8
board_rev_scheme=1
board_revision=0xA02082
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 usb0 pxe dhcp
bootargs=dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
bootcmd=run fdt_load ; run linux_load ; booti $loadaddr - $fdt_addr_r
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=2
cpu=armv8
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
ethact=sms0
fdt_addr_r=0x00000100
fdt_high=ffffffff
fdt_load=fatload mmc 0:1 $fdt_addr_r $fdtfile
fdtfile=bcm2837-rpi-3-b.dtb
fileaddr=200000
filesize=861400
initrd_high=ffffffff
kernel_addr_r=0x01000000
linux_load=fatload mmc 0:1 $loadaddr image
loadaddr=0x00200000
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
preboot=usb start
pxefile_addr_r=0x00100000
ramdisk_addr_r=0x02100000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; de
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype e
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_ei
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}e
scriptaddr=0x02000000
serial#=000000008ea586f8
soc=bcm283x
stderr=serial,lcd
stdin=serial,usbkbd
stdout=serial,lcd
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
vendor=raspberrypi

Environment size: 2697/16380 bytes


In fact it is nearly default: I packed this into the uboot auto start.
Code:
fatload mmc 0:1 $fdt_addr_r bcm2837-rpi-3-b.dtb
fatload mmc 0:1 $loadaddr image
booti $loadaddr - $fdt_addr_r


You can enter these commands into the uboot to start the image. Important is afaik also the cmdline.txt
Code:
cat p1/config.txt
dtoverlay=pi3-miniuart-bt-overlay
kernel=u-boot.bin
kernel_old=1
arm_control=0x200
disable_commandline_tags=1


_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage


Last edited by schorsch_76 on Sun Mar 27, 2016 10:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Sun Mar 27, 2016 10:15 pm    Post subject: Reply with quote

The explanation is more useful i think, but i leave the listing abouve for completeness:

I added in the u boot console
Code:

U-Boot> setenv linux_load 'fatload mmc 0:1 $loadaddr image'
U-Boot> setenv fdt_load 'fatload mmc 0:1 $fdt_addr_r $fdtfile'
U-Boot> setenv fdtfile 'bcm2837-rpi-3-b.dtb'
U-Boot> setenv bootcmd 'run fdt_load ; run linux_load ; booti $loadaddr - $fdt_addr_r'
U-Boot> setenv bootargs 'dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait'
U-Boot> saveenv


Very important are the ' !
Now after you plug it in again, it reads uboot.env and after 2 sec it loads the dts and the image and boots it

Now the kernel command line is no longer read from the cmdline.txt but provided now via u-boot. I dont know yet how to read the cmdline.txt via u boot and pass it as bootargs. But i guess it is possible ;)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Sun Mar 27, 2016 10:21 pm    Post subject: Reply with quote

schorsch_76,

I had console=tty1 in my cmdline.txt but everything else was correct, including the serial port set up.
I also had too many zeros in the kernel load address.

The other difference is I get
Code:
** Unable to read "uboot.env" from mmc0:1 **
Using default environment


How do you get one of those.

Hmm I guess that cmdline.txt is not used with u-boot, so I'm booting with a blank command line.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Sun Mar 27, 2016 10:29 pm    Post subject: Reply with quote

The explanation above creates it. 8)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Sun Mar 27, 2016 10:48 pm    Post subject: Reply with quote

schorsch_76,

NeddySeagoon wrote:
Hmm I guess that cmdline.txt is not used with u-boot, so I'm booting with a blank command line.

That looks like it was the problem. I had a console using black text on a black background :)

I've messed up something because I get a well known panic now.
Code:
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -19
Please append a correct "root=" boot option; here are the available partitions:
b300        62367744 mmcblk0  driver: mmcblk
  b301           65536 mmcblk0p1 00000000-01
  b302        10485760 mmcblk0p2 00000000-02
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)


Its much easier with the uboot.env file. Mine is still wrong but it picked up the bootargs this time.

Thanks for your help. Its midnight here. With the change to DST thin weekend, I have to be up early.
More tomorow.

I have some userspace stuff but its missing gcc.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Mon Mar 28, 2016 9:27 am    Post subject: Reply with quote

You are welcome Neddy! You helped me more than once. ;)

I try to build the native gcc for aarch64. buildroot bropped the target gcc about 2012. Now i try to cross compile the native aarch gcc .... :?
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Mon Mar 28, 2016 5:00 pm    Post subject: Reply with quote

I got a pure C compiler cross compiled. I always failed at the c++ lib stage.

I used that script that i copied from [1] and i adjusted it slightly:
Code:

#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT

#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
#
# See: http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler
#-------------------------------------------------------------------------------------------

INSTALL_PATH=/opt/cross
HOST=aarch64-linux-gnu
TARGET=aarch64-linux-gnu
USE_NEWLIB=0
LINUX_ARCH=arm64
CONFIGURATION_OPTIONS="--disable-multilib" # --disable-threads --disable-shared
PARALLEL_MAKE=-j16
BINUTILS_VERSION=binutils-2.25
GCC_VERSION=gcc-5.3.0
LINUX_KERNEL_VERSION=linux-4.5
GLIBC_VERSION=glibc-2.22
MPFR_VERSION=mpfr-3.1.2
GMP_VERSION=gmp-6.0.0a
MPC_VERSION=mpc-1.0.2
ISL_VERSION=isl-0.12.2
CLOOG_VERSION=cloog-0.18.1
#export PATH=$INSTALL_PATH/bin:$PATH
export CC=$HOST-gcc
export CXX=$HOST-g++

# Download packages
export http_proxy=$HTTP_PROXY https_proxy=$HTTP_PROXY ftp_proxy=$HTTP_PROXY
wget -nc https://ftp.gnu.org/gnu/binutils/$BINUTILS_VERSION.tar.gz
wget -nc https://ftp.gnu.org/gnu/gcc/$GCC_VERSION/$GCC_VERSION.tar.gz
if [ $USE_NEWLIB -ne 0 ]; then
    wget -nc -O newlib-master.zip https://github.com/bminor/newlib/archive/master.zip || true
    unzip -qo newlib-master.zip
else
    wget -nc https://www.kernel.org/pub/linux/kernel/v4.x/$LINUX_KERNEL_VERSION.tar.xz
    wget -nc https://ftp.gnu.org/gnu/glibc/$GLIBC_VERSION.tar.xz
fi
wget -nc https://ftp.gnu.org/gnu/mpfr/$MPFR_VERSION.tar.xz
wget -nc https://ftp.gnu.org/gnu/gmp/$GMP_VERSION.tar.xz
wget -nc https://ftp.gnu.org/gnu/mpc/$MPC_VERSION.tar.gz
wget -nc ftp://gcc.gnu.org/pub/gcc/infrastructure/$ISL_VERSION.tar.bz2
wget -nc ftp://gcc.gnu.org/pub/gcc/infrastructure/$CLOOG_VERSION.tar.gz

# Extract everything
for f in *.tar.gz; do tar -xzf $f; done
for f in *.tar.bz2; do tar -xjf $f; done
for f in *.tar.xz; do tar -xJf $f; done

# Make symbolic links
cd $GCC_VERSION
ln -sf `ls -1d ../mpfr-*/` mpfr
ln -sf `ls -1d ../gmp-*/` gmp
ln -sf `ls -1d ../mpc-*/` mpc
ln -sf `ls -1d ../isl-*/` isl
ln -sf `ls -1d ../cloog-*/` cloog
cd ..

# Step 1. Binutils
mkdir -p build-binutils
cd build-binutils
../$BINUTILS_VERSION/configure --prefix=$INSTALL_PATH --target=$TARGET $CONFIGURATION_OPTIONS --host=$HOST
make $PARALLEL_MAKE
make install
cd ..

# Step 2. Linux Kernel Headers
if [ $USE_NEWLIB -eq 0 ]; then
    cd $LINUX_KERNEL_VERSION
    make ARCH=$LINUX_ARCH INSTALL_HDR_PATH=$INSTALL_PATH/$TARGET headers_install
    cd ..
fi

# Step 3. C/C++ Compilers
mkdir -p build-gcc
cd build-gcc
if [ $USE_NEWLIB -ne 0 ]; then
    NEWLIB_OPTION=--with-newlib
fi
../$GCC_VERSION/configure --prefix=$INSTALL_PATH --host=$HOST --target=$TARGET --enable-languages=c $CONFIGURATION_OPTIONS $NEWLIB_OPTION
make $PARALLEL_MAKE all-gcc
make install-gcc
cd ..

if [ $USE_NEWLIB -ne 0 ]; then
    # Steps 4-6: Newlib
    mkdir -p build-newlib
    cd build-newlib
    ../newlib-master/configure --host=$HOST --prefix=$INSTALL_PATH --target=$TARGET $CONFIGURATION_OPTIONS
    make $PARALLEL_MAKE
    make install
    cd ..
else
    # Step 4. Standard C Library Headers and Startup Files
    mkdir -p build-glibc
    cd build-glibc
    ../$GLIBC_VERSION/configure --prefix=$INSTALL_PATH/$TARGET --build=$MACHTYPE --host=$TARGET --target=$TARGET --with-headers=$INSTALL_PATH/$TARGET/include $CONFIGURATION_OPTIONS
    make install-bootstrap-headers=yes install-headers
    make $PARALLEL_MAKE csu/subdir_lib
    install csu/crt1.o csu/crti.o csu/crtn.o $INSTALL_PATH/$TARGET/lib
    $TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $INSTALL_PATH/$TARGET/lib/libc.so
    touch $INSTALL_PATH/$TARGET/include/gnu/stubs.h
    cd ..

    # Step 5. Compiler Support Library
    cd build-gcc
    make $PARALLEL_MAKE all-target-libgcc
    make install-target-libgcc
    cd ..

    # Step 6. Standard C Library & the rest of Glibc
    cd build-glibc
    make $PARALLEL_MAKE
    make install
    cd ..
fi

# Step 7. Standard C++ Library & the rest of GCC
cd build-gcc
make $PARALLEL_MAKE all
make install
cd ..

trap - EXIT
echo 'Success!'



I copied the /opt/cross folder to the SD card and added /opt/cross/bin to the PATH.

Now i can
Code:

#include <stdio.h>

int main(int argc, char** argv)
{
        printf("Hello aarch64-arm\n");
        return 0;
}


Code:
# gcc main.c
# ./a.out
Hello aarch64-arm


Code:
# gcc --version
gcc (GCC) 5.3.0
Copyright (C) 2015 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.

# file /opt/cross/bin/gcc
/opt/cross/bin/gcc: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, not std


Now i try to build the full compiler with c++ on the target itself with the same script. But enabled c++ language.

[1] http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Mon Mar 28, 2016 6:14 pm    Post subject: Reply with quote

schorsch_76,

I can't get past the login prompt with my userland but adding init=/bin/bash to bootargs gets me a shell, so I'm "in", sortof.
Anyway, I can poke around from the inside now.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Mon Mar 28, 2016 7:02 pm    Post subject: Reply with quote

I had a similar issue as i tried the debian aarch64 userland. pam failed. So i switched to buildroot. I tried the usual /etc/shadow thingie (wiki raspberry pi) but it didnt work.

Is your userland gentoo?

How about using your gentoo userland and my "cross gcc" to emerge the gcc? ;)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Mon Mar 28, 2016 9:39 pm    Post subject: Reply with quote

schorsch_76,

I don't have pam at all. The make.conf that comes free with crossdev has
USE=-pam set.

My part of a userland was obtained by using crossdev to build a aarch64-armv8a-linux-gnueabi cross toolchain then blindly using it to build @system in an empty target root.
Actually in /usr/aarch64-armv8a-linux-gnueabi/. Since I've not done anything special, except keyword a few packages, its done fairly well.

Maybe setting the profile to
Code:
make.profile ->/usr/portage/profiles/default/linux/arm64/13.0/desktop
was a bit
aggressive when I didn't even have a @system set. That is not the cause of build issues though.

You will find Pi3_64_bit_root.tbz2 and Pi3_64_bit_boot.tbz2 at http://grytpype-thynne.org/~roy/Pi3_64bit/
They are the partition2 (ext4) and partition1 (vfat) copied from my SDCard.
The root password is raspberry but it doesn't work.
To poke about, append init=/bin/bash to bootargs and press return when
it looks like its died.
That's just you, bash and the kernel with a read only root.

Before you run emerge natively in arm64 you need to fix make.conf. Its still as it was for cross compiling.

It doesn't always give the login prompt. When it does, it doesn't always echo the username.
It never echos the password, nor gives any indication the the enter character at the end of the password was accepted.

Have fun.

**** edit ****

Login fix ....
edit /etc/inittab

Fix this line
Code:
# SERIAL CONSOLES
s0:12345:respawn:/sbin/agetty -L 115200 ttyAMA0 vt100
Change vt320 to reah vt100

Comment this line
Code:
# Architecture specific features
#f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100

Notice that it will cause a race condition as it resets the console baud rate.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Tue Mar 29, 2016 6:15 am    Post subject: Reply with quote

Hi Neddy,

i try this today evening. :)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Tue Mar 29, 2016 6:35 pm    Post subject: Reply with quote

schorsch_76,

I have a working cross gcc and cross c++ and all the other good things built using crossdev.
They all seem to work.

Those programs run on an amd64 and produce code for aarch64-armv8a-linux-gnueabi using the files in /usr/aarch64-armv8a-linux-gnueabi/etc/portage.
This is all normal Gentoo but with the cross compiler twist.

I see how your script builds you a cross tool chain that ends up in
Code:
INSTALL_PATH=/opt/cross


I don't follow your
schorsch_76 wrote:
I copied the /opt/cross folder to the SD card and added /opt/cross/bin to the PATH.

because the code there is to run on your build host, not the armv8 target.

How did you use those tools to get a native armv8 gcc?
My attempt to use the cross toolchain to cross compile gcc itself ends with
Code:
 /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../libdecnumber/libdecnumber.a(decNumber.o): Relocations in generic ELF (EM: 183)
../libdecnumber/libdecnumber.a: error adding symbols: File in wrong format
so its using the wrong linker.

I tried the USB ports. Surprise suprise .. they don't work. :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Tue Mar 29, 2016 6:37 pm    Post subject: Reply with quote

Now i got everything on the SD card and logged into it. gcc is on it. Now it tries to compile m4/flex/bison/gcc.

It got a 1 GB swap file ... Hopefully it will succeed. I press my thumbs ... :)

M4/flex just got compiled. Good sign 8)

https://www.schorsch-tech.de/lib/exe/fetch.php?media=linux:rpi3-compiles.png

@Neddy: You are a genius about cross compiling gentoo! I tried this too but failed (thus buildroot)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage


Last edited by schorsch_76 on Tue Mar 29, 2016 6:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Tue Mar 29, 2016 6:44 pm    Post subject: Reply with quote

The script i posted a few das ago needs a cross compiler from cross dev (host: amd64 target: aarch64). In fact, This script cross compiles a compiler for the target that it can natively compile ;) "Cross compiling a native compiler"

The "--host" in the configure steps specifies that host the target will run. See my /opt/cross/bin/gcc

In fact, i set /"opt/cross" owned by my regular user to make sure the aarch64 dont get mixed up with my other cross compiler in /usr. So i compiled the "/opt/cross" as normal user and installed it as normal user. It only runs on aarch64 not on my amd64 host. I havemt known about sysroot .. though .... /opt/cross later copied to the RPi3

Code:
hammerhead opt # file /opt/cross/bin/gcc
/opt/cross/bin/gcc: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, not stripped


EDIT: I upload my toolchain that you can download it ;)
EDIT2: Here is the toolchain
https://www.schorsch-tech.de/rpi3/cross.tar.bz2

EDIT3: my gcc could not compile gcc on the RPI. :(
Code:
checking for unsigned long long int... yes
checking for uintmax_t... yes
checking for uintptr_t... yes
checking for int64_t underlying type... long long
configure: error: error verifying int64_t uses long long
Makefile:4159: recipe for target 'configure-stage1-gcc' failed
make[2]: *** [configure-stage1-gcc] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build'
Makefile:19012: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build'
Makefile:19343: recipe for target 'bootstrap-lean' failed
make: *** [bootstrap-lean] Error 2
 * ERROR: sys-devel/gcc-5.3.0::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-devel/gcc-5.3.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-5.3.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/gcc-5.3.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-5.3.0/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build'
 * S: '/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0'
 *
 * Please include /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-build-logs.tar.bz2 in your bug report.
 *

>>> Failed to emerge sys-devel/gcc-5.3.0, Log file:

>>>  '/var/tmp/portage/sys-devel/gcc-5.3.0/temp/build.log'

 * Messages for package sys-devel/gcc-5.3.0:

 * ERROR: sys-devel/gcc-5.3.0::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-devel/gcc-5.3.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-5.3.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/gcc-5.3.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-5.3.0/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build'
 * S: '/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0'
 *
 * Please include /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-build-logs.tar.bz2 in your bug report.

_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54587
Location: 56N 3W

PostPosted: Tue Mar 29, 2016 10:05 pm    Post subject: Reply with quote

schorsch_76,

After some 'faffing' about, I have the portage tree, the sources for gcc and your native armv8 gcc on my Pi.

If I can get emerge to use your gcc, my plan is to
Code:
emerge gcc --nodeps -1

select the resulting gcc. Then run
Code:
/usr/portage/scripts/bootstrap.sh

which is the stage1 install.

Of course, none of the I/O works except the serial console, so it will be a sneakernet install.
I don't fancy PPP over a serial link at 115200 bits/sec. Nor kermit or [xyz]modem for file transfer.
That would almost be back to baseband modem speeds.

Progress so far ...
Code:
root@Pi_3 64_bit ~ # emerge gcc --nodeps -av1                                                                                                                                   

 * IMPORTANT: 5 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


These are the packages that would be merged, in order:

[ebuild  N     ] sys-devel/gcc-5.3.0:5.3.0::gentoo  USE="cxx fortran (multilib) nls nptl openmp sanitize (-altivec) (-awt) (-cilk) -debug (-doc) (-fixed-point) (-gcj) -go (-grap
hite) (-hardened) -jit (-libssp) -multislot -nopie -nossp -objc -objc++ -objc-gc (-regression-test) -vanilla" 0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests
>>> Running pre-merge checks for sys-devel/gcc-5.3.0

>>> Emerging (1 of 1) sys-devel/gcc-5.3.0::gentoo
 * gcc-5.3.0.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                [ ok ]
 * gcc-5.3.0-uclibc-patches-1.0.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...   [ ok ]
 * gcc-5.3.0-patches-1.0.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...    [ ok ]
 * gcc-5.3.0-piepatches-v0.6.5.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...  [ ok ]
 * gcc-4.4.3-specs-0.2.0.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...    [ ok ]
>>> Unpacking source...
>>> Unpacking gcc-5.3.0.tar.bz2 to /var/tmp/portage/sys-devel/gcc-5.3.0/work


This is the wrong package to practice on. If it doesn't find gcc, its going to unpack in all again at the next attempt.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Wed Mar 30, 2016 7:27 am    Post subject: Reply with quote

Yes, i put the distfiles to the sdcard like you. That emerge grabbed my new gcc i exported "CC=/opt/cross/bin/gcc" Flex/Bison/m4 were compiled by this gcc and they work.

The unpacking stage took for me about 20 to 30 min. At the configure stage it failed at a type check for int64_t ...

So i tried yesterday various Versions of gcc and libs to "cross compile the compiler" but they all failed at the libstdc++3 stage at "vnsprintf" (dont habe the error currently here). I am up to fill a bug report on gcc.gnu.org/bugzilla.

The check for int64_t on the target is strange too ... that this fails ....
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Wed Mar 30, 2016 12:29 pm    Post subject: Reply with quote

@neddy: I Thing the correct target triple for aarch64 is:
aarch64-linux-gnu

See:
https://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/Specifying-Target-Triplets.html

and in Debian they name it aarch64-linux-gnu too.
https://wiki.debian.org/Arm64Port
Code:
'arm64' is the Debian port name for the 64-bit ARMv8 architecture, referred to as 'aarch64' in upstream toolchains (GNU triplet aarch64-linux-gnu), and some other distros.

_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Wed Mar 30, 2016 4:15 pm    Post subject: Reply with quote

The error, that occours when i try to "cross compile the native compiler" for aarch64 is always:
Code:

make[4]: Leaving directory '/home/georg/intern/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libitm/testsuite'
make[4]: Entering directory '/home/georg/intern/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libitm'
/bin/sh ./libtool --tag=CXX   --mode=compile aarch64-armv8a-linux-gnueabi-c++ -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libstdc++-v3/src/.libs -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libstdc++-v3/libsupc++/.libs   -DHAVE_CONFIG_H -I. -I../../../gcc-5.3.0/libitm  -I../../../gcc-5.3.0/libitm/config/linux/aarch64 -I../../../gcc-5.3.0/libitm/config/linux -I../../../gcc-5.3.0/libitm/config/aarch64 -I../../../gcc-5.3.0/libitm/config/posix -I../../../gcc-5.3.0/libitm/config/generic -I../../../gcc-5.3.0/libitm  -ftls-model=initial-exec -Wall -Werror  -Wc,-pthread -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -g -O2 -D_GNU_SOURCE -MT util.lo -MD -MP -MF .deps/util.Tpo -c -o util.lo ../../../gcc-5.3.0/libitm/util.cc
libtool: compile:  aarch64-armv8a-linux-gnueabi-c++ -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libstdc++-v3/src/.libs -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libstdc++-v3/libsupc++/.libs -DHAVE_CONFIG_H -I. -I../../../gcc-5.3.0/libitm -I../../../gcc-5.3.0/libitm/config/linux/aarch64 -I../../../gcc-5.3.0/libitm/config/linux -I../../../gcc-5.3.0/libitm/config/aarch64 -I../../../gcc-5.3.0/libitm/config/posix -I../../../gcc-5.3.0/libitm/config/generic -I../../../gcc-5.3.0/libitm -ftls-model=initial-exec -Wall -pthread -Werror -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -g -O2 -D_GNU_SOURCE -MT util.lo -MD -MP -MF .deps/util.Tpo -c ../../../gcc-5.3.0/libitm/util.cc  -fPIC -DPIC -o .libs/util.o
In file included from /usr/aarch64-armv8a-linux-gnueabi/usr/include/stdio.h:936:0,
                 from ../../../gcc-5.3.0/libitm/util.cc:27:
/usr/aarch64-armv8a-linux-gnueabi/usr/include/bits/stdio2.h: In function 'void GTM::gtm_verror(const char*, va_list)':
/usr/aarch64-armv8a-linux-gnueabi/usr/include/bits/stdio2.h:124:1: error: inlining failed in call to always_inline 'int vfprintf(FILE*, const char*, __gnuc_va_list)': function body can be overwritten at link time
 vfprintf (FILE *__restrict __stream,
 ^
../../../gcc-5.3.0/libitm/util.cc:35:31: error: called from here
   vfprintf (stderr, fmt, list);
                               ^
Makefile:517: recipe for target 'util.lo' failed


I tried:
- "amd64 to aarch64 Compiler 5.3.0" aarch64-linux-gnu triplet and aarch64-armv8a-linux-gnueabi. Both fail at the exact same line.
- "aarch64 to aarch64" compilers 5.3.0 and 4.9.3 failed at the same function (post above copied from the minicom)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage


Last edited by schorsch_76 on Wed Mar 30, 2016 4:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 452

PostPosted: Wed Mar 30, 2016 4:31 pm    Post subject: Reply with quote

Bug to gcc submitted:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum