ClangBuiltLinux / continuous-integration

Continuous integration of latest Linux kernel with daily build of Clang & LLVM tools
https://travis-ci.com/ClangBuiltLinux/continuous-integration
Apache License 2.0
44 stars 18 forks source link

Enable LLD for MIPS #259

Closed nathanchance closed 4 years ago

nathanchance commented 4 years ago

By switching to malta_kvm_guest_defconfig, we can enable ld.lld now. See individual commit messages for reasoning.

Presubmit: https://travis-ci.com/github/nathanchance/continuous-integration/builds/158431604

nathanchance commented 4 years ago

I am not sure I understand the confusion? The diff in the lore link fixes the issue for malta_defconfig but we can avoid the issue altogether by using malta_kvm_guest_defconfig, which just enables CONFIG_BLK_DEV_INITRD, some VIRTIO configs, and CONFIG_KVM_GUEST.

$ git diff --no-index arch/mips/configs/malta_defconfig arch/mips/configs/malta_kvm_guest_defconfig
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_kvm_guest_defconfig
index 211bd3d6e6cb..9185e0a0aa45 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_kvm_guest_defconfig
@@ -4,14 +4,16 @@ CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=15
 CONFIG_NAMESPACES=y
 CONFIG_RELAY=y
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
 CONFIG_MIPS_MALTA=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_CPU_MIPS32_R2=y
+CONFIG_KVM_GUEST=y
 CONFIG_PAGE_SIZE_16KB=y
-CONFIG_NR_CPUS=8
+# CONFIG_MIPS_MT_SMP is not set
 CONFIG_HZ_100=y
 CONFIG_PCI=y
 CONFIG_MODULES=y
@@ -234,6 +236,10 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_ATA_OVER_ETH=m
+CONFIG_VIRTIO_BLK=y
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_TC86C001=m
 CONFIG_RAID_ATTRS=m
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=m
@@ -254,6 +260,10 @@ CONFIG_AIC7XXX_RESET_DELAY_MS=15000
 # CONFIG_AIC7XXX_DEBUG_ENABLE is not set
 CONFIG_ATA=y
 CONFIG_ATA_PIIX=y
+CONFIG_PATA_IT8213=m
+CONFIG_PATA_OLDPIIX=y
+CONFIG_PATA_MPIIX=y
+CONFIG_ATA_GENERIC=y
 CONFIG_PATA_LEGACY=y
 CONFIG_MD=y
 CONFIG_BLK_DEV_MD=m
@@ -278,7 +288,7 @@ CONFIG_IFB=m
 CONFIG_MACVLAN=m
 CONFIG_TUN=m
 CONFIG_VETH=m
-# CONFIG_NET_VENDOR_3COM is not set
+CONFIG_VIRTIO_NET=y
 CONFIG_PCNET32=y
 CONFIG_CHELSIO_T3=m
 CONFIG_AX88796=m
@@ -306,7 +316,6 @@ CONFIG_HOSTAP_PCI=m
 CONFIG_PRISM54=m
 CONFIG_LIBERTAS=m
 CONFIG_INPUT_MOUSEDEV=y
-CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_POWER_RESET=y
@@ -322,6 +331,9 @@ CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_CMOS=y
 CONFIG_UIO=m
 CONFIG_UIO_CIF=m
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_BALLOON=y
+CONFIG_VIRTIO_MMIO=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 CONFIG_REISERFS_FS=m

I think regardless of the ld.lld error, we should probably be building malta_kvm_guest_defconfig anyways because we are only booting in QEMU, not on bare metal. As far as I can tell, that is the one that should be used when booting via QEMU. It isn't really fair for us to claim that malta_defconfig works when we are doing it purely virtualized AND it is misleading for other developers who expect to build malta_defconfig from upstream and boot it properly with boot-utils.

It would be nice to get coverage with ld.lld on MIPS to make sure nothing regresses but I'll leave the decision up to you to merge this or not.

nickdesaulniers commented 4 years ago

It isn't really fair for us to claim that malta_defconfig works when we are doing it purely virtualized AND it is misleading for other developers who expect to build malta_defconfig from upstream and boot it properly with boot-utils.

Could that argument be made for all the rest of our targets, though? s/malta_defconfig/armv7 multi defconfig/.

malta_kvm_guest_defconfig anyways because we are only booting in QEMU, not on bare metal.

That's fair.

nathanchance commented 4 years ago

Could that argument be made for all the rest of our targets, though? s/malta_defconfig/armv7 multi defconfig/.

Doesn't KernelCI boot multi_v7_defconfig on bare metal? But yes, that is a fair counter argument for sure.

Thanks for the review as always!

nickdesaulniers commented 4 years ago

Doesn't KernelCI boot multi_v7_defconfig on bare metal?

KernelCI boot tests with Clang are currently disabled. We can look to re-enable them.