Tux Machines

Do you waddle the waddle?

Other Sites

LinuxGizmos.com

Forlinx Unveils Cost-Effective i.MX8MPL-C SoM for Industrial Applications

Forlinx Embedded recently introduced the FETMX8MPL-C SoM, a cost-effective solution for industrial and IoT applications that balances performance and functionality without incorporating advanced multimedia or machine learning features.

Atomic Echo Base Enables Voice Recognition for M5 Atom Series

Ubuntu Buzz !

How To Create Desktop Shortcuts on Kubuntu

This tutorial will show you how to create desktop shortcuts on Kubuntu. Kubuntu is a computer operating system based on Ubuntu with KDE Plasma Desktop technology. Here we use Kubuntu 24.04 LTS "Noble Numbat" which has been released this year. This covers making normal application shortcuts, as well as file, document and even custom command line ones on desktop area for quick access. Finally, we include examples and easy to follow procedures so you can practice it immediately on your computer. Happy computing with Kubuntu and we wish you success!

news

Overview of cross-architecture portability problems

posted by Roy Schestowitz on Sep 24, 2024

Ideally, you’d want your program to work everywhere. Unfortunately, that’s not that simple, even if you’re using high-level “portable” languages such as Python. In this blog post, I’d like to focus on some aspects of cross-architecture problems I’ve seen or heard about during my time in Gentoo. Please note that I don’t mean this to be a comprehensive list of problems — instead, I’m aiming for an interesting read.

What breaks programs on 32-bit systems?

Basic integer type sizes

If you asked anyone what’s the primary difference between 64-bit and 32-bit architectures, they will probably answer that it’s register sizes. For many people, register sizes imply differences in basic integer types, and therefore the primary source of problems on 32-bit architectures, when programs are tested on 64-bit architectures only (which is commonly the case nowadays). Actually, it’s not that simple.

Contrary to common expectations, the differences in basic integer types are minimal. Most importantly, your plain int is 32-bit everywhere. The only type that’s actually different is long — it’s 32-bit on 32-bit architectures, and 64-bit on 64-bit architectures. However, people don’t use long all that often in modern programs, so that’s not very likely to cause issues.

Perhaps some people worry about integer sizes because they still foggily remember the issues from porting old 32-bit software to 64-bit architectures. As I’ve mentioned before, int remained 32-bit — but pointers became 64-bit. As a result, if you attempted to cast pointers (or related data) to int, you’d be in trouble (hence we have size_t, ssize_t, ptrdiff_t). Of course, the same thing (i.e. casting pointers to long) made for 64-bit architectures is ugly but won’t technically cause problems on 32-bit architectures.

Note that I’m talking about System V ABI here. Technically, the POSIX and the C standards don’t specify exact integer sizes, and permit a lot more flexibility (the C standard especially — up to having, say, all the types exactly 32-bit).

Address space size

Now, a more likely problem is the address space limitation. Since pointers are 32-bit on 32-bit architectures, a program can address no more than 4 GiB of memory (in reality, somewhat less than that). What’s really important here is that this limits allocated memory, even it is never actually used.

This can cause curious issues. For example, let’s say that you have a program that allocates a lot of memory, but doesn’t use most of it. If you run this program on a 64-bit system with 2 GiB of total memory, it works just fine. However, if you run it on 32-bit userland with a lot of memory, it fails. And why is that? It’s because the system permitted the program to allocate more memory than it could ever provide — risking an OOM if the program actually tried to use it all; but on the 32-bit architecture, it simply cannot fit all these allocations into 32-bit addresses.

The following sample can trivially demonstrate this: [...]

Read on

Other Recent Tux Machines' Posts

Audiocasts/Shows: Self-Hosted and GNU World Order [original]
2 new episodes
Slackware-based Zenwalk Linux returns with "Santa Claus" edition
Overall, it sports the same changes as the latest Slackware refresh
 
Today in Techrights
Some of the latest articles
EasyOS and Free Software Leftovers
today's leftovers
Programming, VIM, and GNU (GIMP)
coding centric update
Games: Steam Games with Native GNU/Linux Clients, Steam Deck Titles, and More
gaming related picks
today's howtos
Instructionals and installing things
Security Leftovers
Security related news picks
Retro, Open Hardware, and Mobile
Phosh, Raspberry Pi, and more
Android Leftovers
Redmi K80 Ultra tipped to launch as high-capacity Android smartphone with next-gen flagship-grade SoC
Databases: Use of Time in Distributed Databases, IvorySQL 4.0, SynchDB 1.0, CloudNativePG 1.25.0 and 1.24.2
mostly psql picks
5 of the Best System Monitoring Tools in Linux
System monitors are a vital part of keeping your PC in top shape. Learn some of the best system monitors that you can install on GNU/Linux today
Release of Ghostty 1.0
Ghostty 1.0 is out
My Favorite Linux Distro for 2024 is Not Ubuntu, Not Mint, It's This
Revealing my favorite Linux distribution before 2024 ends
See Pinned Ubuntu Dock Apps in the Application Grid
You may have noticed (or not) that if an app is pinned to the Ubuntu Dock you don’t see a shortcut for it in the applications grid
Keep putting pressure on Microsoft
Grassroots organization against a corporation as large as Microsoft is never easy
Programming Leftovers
Development picks
today's howtos
Instructionals/Technical picks
Free and Open Source Software
This is free and open source software
Holiday Hacking 2024
Like every year I take a couple of days off at the end of the year to wind down and spent time with the family
This Week in GNOME: #180 Image Editing
Update on what happened across the GNOME project in the week from December 20 to December 27
Plasma power management woes and solutions
Until recently, my Slimbook Executive laptop has worked beautifully
Stable kernels: Linux 6.12.7, Linux 6.6.68, and Linux 6.1.122
All users of the 6.12 kernel series must upgrade
How managing networks differs on Windows 10 and Linux
If you're considering leaving the soon-to-sunsetted Windows 10 for Linux
Windows TCO: Windows Botnets and More
cost of Microsoft on the Net
Today in Techrights
Some of the latest articles
Android Leftovers
You should have these apps on your new Android smartphone
GNU/Linux and Hardware Leftovers
today's leftover links
Free, Libre Software, Openwashing, and More
Espectially FOSS focus
Security Leftovers
Security patches and more
Programming Leftovers
Development and hacking
AI, Hardware and Open Models: Headed in the Linux Direction
From the 1960s onwards, IBM's mainframe systems started the era of proprietary hardware and software, which trickled into the PC
Ruby 3.4.0 Released
"We are pleased to announce the release of Ruby 3.4.0"
AI Image Upscaler 'Upscayl' 2.15 Added Multiple Languages & TTA Mode
Upscayl, the popular free open-source Hey Hi (AI) image upscaler, announced new 2.15 released at Christmas!
9 Major Annoyances With Linux That Look Like a Thing of the Past in 2025
It is a breeze to use GNU/Linux in 2025 with all the major annoyances gone
12 Best Free and Open Source TypeScript-Based Web Content Management Systems
All the software featured here is published under an open source license
today's howtos
Instructionals/Technical picks
Games: Updated Proton Experimental and 2024 In Board Games
Games related, a pair of posts
Windows TCO: Windows Botnet Ransomware
some cautionary tales
Today in Techrights
Some of the latest articles