Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 701200 - net-misc/r8168-8.047.05 fails to compile on linux 5.4.0
Summary: net-misc/r8168-8.047.05 fails to compile on linux 5.4.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: James Le Cuirot
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-11-26 12:23 UTC by M
Modified: 2019-12-27 15:24 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch that fixes the compilation problem (aspm.patch,353 bytes, patch)
2019-11-26 12:25 UTC, M
Details | Diff
Patch to not affect kernels < 5.4.0 (linux-5.4.patch,531 bytes, patch)
2019-12-22 17:01 UTC, ron widler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description M 2019-11-26 12:23:52 UTC
net-misc/r8168-8.047.05 fails to compile on linux 5.4.0 due to pci-aspm.h being merged into pci.h

Reproducible: Always

Steps to Reproduce:
1. Set linux 5.4.0 as active
2. Compile r8168
Actual Results:  
/var/tmp/portage/net-misc/r8168-8.047.05/work/r8168-8.047.05/src/r8168_n.c:60:10: fatal error: linux/pci-aspm.h: No such file or directory
   60 | #include <linux/pci-aspm.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.


Expected Results:  
The package compiles
Comment 1 M 2019-11-26 12:25:04 UTC
Created attachment 597556 [details, diff]
Patch that fixes the compilation problem

Applying this patch fixes the issue by including the correct header.
Comment 2 Celphor 2019-12-07 12:23:08 UTC
Compiles on 5.4.1 without include of <linux/pci-aspm.h>, but the patch should consider the include between >= 2.6.26 and <= 5.4.0
Comment 3 Celphor 2019-12-07 12:24:56 UTC
(In reply to Celphor from comment #2)
> Compiles on 5.4.1 without include of <linux/pci-aspm.h>, but the patch
> should consider the include between >= 2.6.26 and <= 5.4.0

I meant < 5.4.0 ;-)

After proper compilation the driver works fine
Comment 4 M 2019-12-07 18:47:05 UTC
I upgraded to 5.4.2 and still require the patch. Any idea why you don't need it?
Comment 5 ron widler 2019-12-22 17:01:57 UTC
Created attachment 600406 [details, diff]
Patch to not affect kernels < 5.4.0

the functions from `linux/pci-aspm.h` got merged into `pci.h`, 
see here: https://github.com/torvalds/linux/commit/7ce2e76a0420801fb4b53b9e6850940e6b326433

linux/pci.h already gets included in line 40 of `r8168_n.c`, so just not including `pci-aspm.h` for kernels >= 5.4.0 should do the trick.

at least it does for me ;)
Comment 6 Larry the Git Cow gentoo-dev 2019-12-27 15:24:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7e2b380d2ca4eaa70a011507e90bc7dc4729d58

commit e7e2b380d2ca4eaa70a011507e90bc7dc4729d58
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2019-12-27 15:22:03 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2019-12-27 15:22:03 +0000

    net-misc/r8168: Fix building 8.047.05 on Linux 5.4
    
    Closes: https://bugs.gentoo.org/701200
    Package-Manager: Portage-2.3.84, Repoman-2.3.20
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>

 net-misc/r8168/files/linux-5.4.patch | 12 ++++++++++++
 net-misc/r8168/r8168-8.047.05.ebuild |  4 ++++
 2 files changed, 16 insertions(+)