News for hackers. Stuff that matters.
Re:Cross-compiling binaries for Windows is easier than build... by dataflow on Saturday June 18, 2022 @06:53PM (#31794536)
Statically link everything? Including glibc?
Re:Cross-compiling binaries for Windows is easier than build... by jcelerier on Sunday June 19, 2022 @03:36AM (#31797105)
When trying to statically link everything, glibc is not as much a problem as GPU drivers are if you want binaries that work on more than one system
Re:Cross-compiling binaries for Windows is easier than build... by melissalobos on Saturday June 18, 2022 @07:20PM (#31794705)
> Including glibc?

Any reasonable person doing this would use Musl of course.

Re:Cross-compiling binaries for Windows is easier than build... by tedunangst on Saturday June 18, 2022 @09:06PM (#31795244)
And then you discover your program can't resolve hostnames because "DNS responses shouldn't be that big".
Re:Cross-compiling binaries for Windows is easier than build... by speed_spread on Sunday June 19, 2022 @11:50PM (#31806097)
But honestly, they really shouldn't.
Re:Cross-compiling binaries for Windows is easier than build... by ducktective on Sunday June 19, 2022 @03:23AM (#31797028)
Can you explain how musl is related to this DNS resolving problem?
Re:Cross-compiling binaries for Windows is easier than build... by brettdong on Sunday June 19, 2022 @04:35AM (#31797442)
Re:Cross-compiling binaries for Windows is easier than build... by kazinator on Saturday June 18, 2022 @10:22PM (#31795564)
Trick question: glibc doesn't support that.

Trying to statically link with glibc is a fool's errand.

Re:Cross-compiling binaries for Windows is easier than build... by account42 on Tuesday June 21, 2022 @04:10AM (#31821510)
glibc doesn't support static linking, but you can fully static link with another libc if that is what you wanted to do.

Not that it is needed for forward-compatible Linux binaries since newer glibc versions are backwards compatible so dynamically linking the oldest one you want to support works fine. Would be nice if glibc/gcc supported targetting older versions directly without having to have an older copy installed but that is a convenience issue.

Re:Cross-compiling binaries for Windows is easier than build... by ajvs on Saturday June 18, 2022 @07:38PM (#31794795)
AppImage is sufficient.
Re:Cross-compiling binaries for Windows is easier than build... by ranger_danger on Saturday June 18, 2022 @11:28PM (#31795875)
nope, it still requires at least the glibc version that the appimage was compiled against. snaps, flatpaks nor appimage solve the long-standing glibc versioning issue that plagues portable Linux binaries. the closest I've seen to fixing this issue is https://github.com/wheybags/glibc_version_header
Re:Cross-compiling binaries for Windows is easier than build... by account42 on Tuesday June 21, 2022 @04:11AM (#31821527)
> the closest I've seen to fixing this issue is https://github.com/wheybags/glibc_version_header

Or just compile against an older glibc version. Plenty of tools to setup sysroots for that, e.g. https://wiki.gentoo.org/wiki/Crossdev