Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1574604

Summary: Out-of-tree kernel modules fail to build on ppc64 with 4.16 kernel
Product: [Fedora] Fedora Reporter: Matt K Light <mklight>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 27CC: airlied, bskeggs, dan, ewk, hannsj_uhl, hdegoede, ichavero, itamar, jarodwilson, jglisse, john.j5live, jonathan, josef, kernel-maint, labbott, linville, mchehab, mjg59, steved
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-4.16.8-300.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-14 17:55:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1071880    

Description Matt K Light 2018-05-03 16:08:48 UTC
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Build Identifier: 

Compiling OpenAFS on Fedora27 ppc64 with 4.16 Linux kernel fails due to missing file module.lds
Compile had worked with 4.15 kernel
This bug is similar to https://bugzilla.redhat.com/show_bug.cgi?id=1531182

Here is the kernel change:
# diff -up /lib/modules/4.15.17-300.fc27.ppc64/build/arch/powerpc/Makefile /lib/modules/4.16.5-200.fc27.ppc64/build/arch/powerpc/Makefile 
--- /lib/modules/4.15.17-300.fc27.ppc64/build/arch/powerpc/Makefile	2018-03-15 12:59:04.000000000 -0500
+++ /lib/modules/4.16.5-200.fc27.ppc64/build/arch/powerpc/Makefile	2018-04-19 15:26:32.000000000 -0500
@@ -63,6 +63,7 @@ UTS_MACHINE := $(subst $(space),,$(machi
 ifdef CONFIG_PPC32
 KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
 else
+KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/powerpc/kernel/module.lds
 ifeq ($(call ld-ifversion, -ge, 225000000, y),y)
 # Have the linker provide sfpr if possible.
 # There is a corresponding test in arch/powerpc/lib/Makefile

kernel-devel package does not seem to contain arch/powerpc/kernel/module.lds
Copying module.lds from github allowed module compile to complete.

Reproducible: Always

Steps to Reproduce:
1.Install openafs pacakages after building from SRPMS on ppc64 system
2.dkms build openafs/1.6.22.2-1.fc27 -k 4.16.5-200.fc27.ppc64/ppc64
3.grep -B5 Error /var/lib/dkms/openafs/1.6.22.2-1.fc27/build/config.log
Actual Results:  
  ld -EB -m elf64ppc -r  -T ./scripts/module-common.lds -T ./arch/powerpc/kernel/module.lds --save-restore-funcs --build-id  -o /var/lib/dkms/openafs/1.6.22.2-1.fc27/build/conftest.dir/conftest.ko /var/lib/dkms/openafs/1.6.22.2-1.fc27/build/conftest.dir/conftest.o /var/lib/dkms/openafs/1.6.22.2-1.fc27/build/conftest.dir/conftest.mod.o ;  make -f ./arch/powerpc/Makefile.postlink /var/lib/dkms/openafs/1.6.22.2-1.fc27/build/conftest.dir/conftest.ko
make: Leaving directory '/usr/src/kernels/4.16.5-200.fc27.ppc64'
ld: cannot open linker script file ./arch/powerpc/kernel/module.lds: No such file or directory
make[1]: *** [scripts/Makefile.modpost:129: /var/lib/dkms/openafs/1.6.22.2-1.fc27/build/conftest.dir/conftest.ko] Error 1
make: *** [Makefile:1569: modules] Error 2


Expected Results:  
dkms build should have finished successfully

Comment 1 Dan HorĂ¡k 2018-05-03 16:21:40 UTC
Fix similar to https://src.fedoraproject.org/rpms/kernel/c/23e036f36c5a1535bcb4eaa5510c108195c9d8da?branch=master is needed. Maybe a generic solution would be better as arch/*/kernel/module.lds exists for arm64, arm, m68k, powerpc and riscv in the mainline kernel tree.

Comment 2 Laura Abbott 2018-05-04 20:21:51 UTC
Fix added, should be picked up in the next stable release sometime next week.

Comment 3 Fedora Update System 2018-05-11 14:05:41 UTC
kernel-4.16.8-300.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-ac3b4c7605

Comment 4 Fedora Update System 2018-05-12 19:35:35 UTC
kernel-4.16.8-300.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-ac3b4c7605

Comment 5 Fedora Update System 2018-05-14 17:55:32 UTC
kernel-4.16.8-300.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.