Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 788430 - sys-devel/clang: paths not set correctly for mingw
Summary: sys-devel/clang: paths not set correctly for mingw
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-05-05 21:28 UTC by Mark Harmstone
Modified: 2022-06-22 18:41 UTC (History)
4 users (show)

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


Attachments
patch to fix issue (mingw.patch,3.54 KB, patch)
2021-05-05 21:30 UTC, Mark Harmstone
Details | Diff
patch updated for clang 14.0.5 (mingw-patch.patch,3.38 KB, patch)
2022-06-22 18:21 UTC, Mark Harmstone
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Harmstone 2021-05-05 21:28:36 UTC
At present, clang can't be used as a replacement for x86_64-w64-mingw32-gcc, as it doesn't understand Gentoo's directory layout. There's workarounds for this upstream in clang/lib/Driver/ToolChains/Gnu.cpp, but no equivalent code in MinGW.cpp.

Reproducible: Always

Steps to Reproduce:
1. install crossdev for x86_64-w64-mingw32
2. try to compile simple program with clang -target x86_64-w64-mingw32

Actual Results:  
clang won't find any header files. If it can be coaxed to do so, it still passes through the wrong paths to the linker.

Expected Results:  
`clang -target x86_64-w64-mingw32` works equivalently to `x86_64-w64-mingw32-gcc`
Comment 1 Mark Harmstone 2021-05-05 21:30:29 UTC
Created attachment 706245 [details, diff]
patch to fix issue
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-05-07 23:36:08 UTC
Please submit this patch to reviews.llvm.org and get upstream to approve it.  Once it's in main, I can backport it to Gentoo.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-05-07 23:36:43 UTC
(please add me to subscribers to your diff, I'm 'mgorny' there)
Comment 4 tt_1 2022-06-22 16:51:12 UTC
hi, was this patch ever pushed to upstream?
Comment 5 Mark Harmstone 2022-06-22 18:20:42 UTC
Submitted but not accepted: https://reviews.llvm.org/D111081
Comment 6 Mark Harmstone 2022-06-22 18:21:13 UTC
Created attachment 786824 [details, diff]
patch updated for clang 14.0.5
Comment 7 tt_1 2022-06-22 18:41:41 UTC
I think upstream asked you to rebase the tests after some other changes were made, so it might be accepted once you rebase? 

I was kind of interested into compiling dxvk libs with x86_64-w64-mingw32-clang, do you think the changes suggested could allow for that?