News for hackers. Stuff that matters.
Re:Welcome Debian riscv64 by sohrob on Sunday July 23, 2023 @11:29PM (#36842802)
When Debian is ported to a new architecture does that mean something special needs to happen to all of the packages in the repository for them to work on that new architecture?
Re:Welcome Debian riscv64 by jffry on Sunday July 23, 2023 @11:39PM (#36842864)
Sounds like they need to cross-compile enough stuff to get a bootable system in the new architecture: https://wiki.debian.org/DebianBootstrap#Cross-building
Re:Welcome Debian riscv64 by pabs3 on Monday July 24, 2023 @10:15AM (#36848358)
Re:Welcome Debian riscv64 by lmm on Sunday July 23, 2023 @11:43PM (#36842887)
Well-written applications will just work. Badly-written applications may require patches or be impractical to build at all, and some system software may not make sense on the architecture at all.

There's a whole lot of build infrastructure for Debian; by default the package maintainer doesn't need to do anything specific, building for all architectures will happen by default.

Re:Welcome Debian riscv64 by totetsu on Monday July 24, 2023 @04:59AM (#36844837)
What kind of assumptions would badly-written applications make to make themselves impractical to cross-build?
Re:Welcome Debian riscv64 by ilyt on Monday July 24, 2023 @05:45AM (#36845194)
Assembler optimizations without fallback to pure C for other architectures for example.
Re:Welcome Debian riscv64 by sanxiyn on Monday July 24, 2023 @05:55AM (#36845297)
All Debian packages are built natively. There is no cross build going on here.
Re:Welcome Debian riscv64 by pabs3 on Monday July 24, 2023 @10:14AM (#36848340)
During the initial port bootstrap process, the initial package set is cross-built using rebootstrap:

https://wiki.debian.org/PortsDocs/New#Bootstrap

Perhaps in the future Debian will be able to have cross-build-only architectures, that have hardware too slow to build software.

Re:Welcome Debian riscv64 by bregma on Monday July 24, 2023 @06:39AM (#36845665)
Othar than word size (eg. i386 vs. x86_64), endianness (eg. PPC vs. x86), alignment (eg. ARM vs. x86) there's plenty of other low-level issues like parameter passing conventions, call frame handling, exception handling, presence or absence of optional instructions or registers, and a number of other subtle gotchas that could affect a port. Instruction probing is one of the ones we run into where everything builds find and fails at runtime.

If you're working at a high enough level you're probably fine. Like the difference between being an auto mechanic and using the app to hail a ride.

Re:Welcome Debian riscv64 by smallpipe on Monday July 24, 2023 @08:44AM (#36847088)
You're missing the biggest one, concurrency model.
Re:Welcome Debian riscv64 by capitol_ on Monday July 24, 2023 @11:07AM (#36849227)
In my packaging work I encounter hard coded assumptions about pointer width, endianness and presence of atomic operations.
Re:Welcome Debian riscv64 by hampereddustbin on Monday July 24, 2023 @11:59AM (#36850055)
I wouldn't go as far as telling something is badly written just because it's written to work on one platform. It can be an exceptional application even when it only works using a single platforms' intrinsics. Similarly a badly written application may work on many platforms
Re:Welcome Debian riscv64 by sanxiyn on Sunday July 23, 2023 @11:49PM (#36842925)
Debian packages declare their supported architectures. "all" means it is architecture independent and will be available to a new architecture without rebuild. "any" means it is portable and will be available to a new architecture by rebuilding. In both cases no source change is needed.

Special packages (for example, compilers generating native code) enumerate supported architectures. For these packages, source change is needed, at least adding the name of the new architecture to the enumeration. But usually that's not the difficult part.

Re:Welcome Debian riscv64 by planede on Monday July 24, 2023 @07:21AM (#36846059)
Maybe some packages may need special attention, like various language runtimes and browsers that normally do JIT compilation to the target architecture. I guess some of these might work in interpreted mode, but not as efficiently.