View previous topic :: View next topic |
Author |
Message |
leyvi Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Sep 2023 Posts: 134
|
Posted: Tue Jan 14, 2025 3:50 pm Post subject: mitmproxy won't build |
|
|
Been trying to emerge net-proxy/mitmproxy, but net-proxy/mitmproxy-rs always fails with the "ld: file format not recognized" error, see the log here. Anyone know how I can fix this? I have a bunch of other packages that fail with the same error, so maybe whatever solves this will solve those, too.
Last edited by leyvi on Tue Jan 14, 2025 4:26 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pingtoo Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 10 Sep 2021 Posts: 1492 Location: Richmond Hill, Canada
|
Posted: Tue Jan 14, 2025 4:11 pm Post subject: |
|
|
You post build.log is for net-proxy/mitmproxy-rs. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sam_ Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/7738740495f7d1acc45bdb.jpg)
Joined: 14 Aug 2020 Posts: 2144
|
Posted: Tue Jan 14, 2025 4:12 pm Post subject: |
|
|
You can't use Rust LTO unless you build with Clang. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
leyvi Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Sep 2023 Posts: 134
|
Posted: Tue Jan 14, 2025 4:26 pm Post subject: |
|
|
sam_, I'm not building it with LTO. pingtoo, yes, I'll correct that. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sam_ Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/7738740495f7d1acc45bdb.jpg)
Joined: 14 Aug 2020 Posts: 2144
|
Posted: Tue Jan 14, 2025 4:50 pm Post subject: |
|
|
The log has '-C linker-plugin-lto' (and later -C lto) but it might be being forced by the upstream project if you're not doing that. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
leyvi Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Sep 2023 Posts: 134
|
Posted: Tue Jan 14, 2025 5:24 pm Post subject: |
|
|
OK, so should I try forcing clang to be the C compiler, just for this build? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sam_ Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/7738740495f7d1acc45bdb.jpg)
Joined: 14 Aug 2020 Posts: 2144
|
Posted: Tue Jan 14, 2025 5:25 pm Post subject: |
|
|
Yes, please give it a go. But please file a bug at bugs.gentoo.org with the build.log and emerge --info. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
leyvi Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Sep 2023 Posts: 134
|
Posted: Tue Jan 14, 2025 5:31 pm Post subject: |
|
|
I tried forcing clang, and there was a slightly different error message: "lto can only be run for executables, cdylibs and static library outputs". Pretty sure it's an upstream problem. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
leyvi Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Sep 2023 Posts: 134
|
Posted: Sun Jan 19, 2025 4:53 pm Post subject: |
|
|
I tried filling a bug report, they were impatient and wouldn't even let me finish describing my bug to them before they closed the report. Now what? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23101
|
Posted: Sun Jan 19, 2025 5:01 pm Post subject: |
|
|
How did they cut you off while you were writing the initial report? They shouldn't even know a report is coming until you finish writing the initial report. Could you link to where this was done, so we can see what was said? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sam_ Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/7738740495f7d1acc45bdb.jpg)
Joined: 14 Aug 2020 Posts: 2144
|
Posted: Sun Jan 19, 2025 5:28 pm Post subject: |
|
|
Presumably you mean bug 948146 where you were not "cut off" at all and we're still waiting for you to come back with fixed configuration. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
leyvi Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Sep 2023 Posts: 134
|
Posted: Sun Feb 02, 2025 2:17 pm Post subject: |
|
|
It seems like my bug was forgotten about, or that whoever was assigned to it got frustrated.
I still can't build it. I have no idea why. Maybe the problem is a corrupted library that needs to be rebuilt?
Or maybe, since I use both GCC and Clang on my system, there's a linker compatibility issue?
Whatever the problem might be, any help would be greatly appreciated. I've been looking forward to using this for a while. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
leyvi Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Sep 2023 Posts: 134
|
Posted: Sat Feb 08, 2025 7:47 pm Post subject: |
|
|
I've found something that may be the cause:
The `ld.bfd` linker is getting used, even though LLVM has been used for everything else. Also, LD="lld" (in both my config _and_ in the environment from the failed build), so this shouldn't be happening.
See this build log for more details:
https://0x0.st/8Pk_.log
Is this perhaps caused by portage itself? I didn't see it in the ebuild, but there's a lot of eclasses used by it... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
leyvi Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Sep 2023 Posts: 134
|
Posted: Wed Feb 12, 2025 11:38 am Post subject: |
|
|
I fixed it!
Here's what I did to my build environment:
-LD="lld"
+LD="ld.lld"
+LDFLAGS="-Wl,-O2 -Wl,--as-needed -fuse-ld=lld"
If you can't tell, I'm using LLVM for this package.
I found the solution on the wiki, under the "Troubleshooting" section of the "Clang" page. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|