Skip to content

Commit d388b04

Browse files
czsgabajayrm
authored andcommitted
rtlib: sys/io.h incorrectly included on systems that do not provide it
- fix rtlib compilation error on/for aarch64 (arm64) or other platforms - use of sys/io.h is only to call ioperm(), and determine permission for direct use out in/out instructions - sys/io.h is used only for x86, x86_64 and is unnecessary for all other linux targets (armhf ,arm64, mips ....)
1 parent 9fc7d15 commit d388b04

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Version 1.07.0
4848
- github #145: WSTRING concat and assign buffer (&=) overrun
4949
- sf.net #893: 'Suffixes are only valid in -lang' error message showing incorrect -lang options allowed
5050
- fbc uses '-march=armv8-a' instead of invalid option '-march=aarch64' when passing options to gcc/LLVM (czsgaba)
51+
- rtlib: sys/io.h incorrectly included on systems that do not provide it. It is used only for x86, x86_64 and is unnecessary for all other linux targets (armhf ,arm64, mips ....)
5152

5253

5354
Version 1.06.0

src/rtlib/unix/hinit.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@
88
#include "../fb_private_thread.h"
99
#include <signal.h>
1010
#include <termcap.h>
11-
#ifdef HOST_LINUX
12-
#include <sys/io.h>
11+
12+
#if defined HOST_LINUX && (defined HOST_X86 || defined HOST_X86_64)
13+
/*
14+
The sys/ headers are architecture and OS dependent. They
15+
do not exist across all targets and io.h in particular
16+
is intended for very low-level non-portable uses often
17+
in coordination with the kernel. The only targets that
18+
provide sys/io.h are x86*, Alpha, IA64, and 32-bit ARM.
19+
No other systems provide it.
20+
From https://bugzilla.redhat.com/show_bug.cgi?id=1116162
21+
or http://www.hep.by/gnu/gnulib/ioperm.html#ioperm
22+
*/
23+
#include <sys/io.h>
1324
#endif
25+
1426
#include <sys/ioctl.h>
1527
#include <fcntl.h>
1628

0 commit comments

Comments
 (0)