Skip to content

Commit d582db4

Browse files
authored
feat: build native Linux x86-64 (amd64), drop 32-bit (#6)
Drop the Linux x86 32-bit (ILP32) build in favour of a native x86-64 (LP64) binary. Removes the gcc-multilib dependency so the compiler builds on a modern stock toolchain. Both Linux architectures (x86-64 and aarch64) are now native 64-bit, so the separate ARM64 Makefile branch merges back into a single Linux branch. The 64-bit host configuration is selected via __LP64__, the same path already used by the macOS and ARM64 builds; no codegen change. The release asset is renamed c2asm370-linux-x86 -> c2asm370-linux-amd64 for consistency with c2asm370-linux-arm64. Bumps version to 1.4.
1 parent 6344fd5 commit d582db4

4 files changed

Lines changed: 14 additions & 28 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- name: Install 32-bit build dependencies
20-
run: |
21-
sudo apt-get update
22-
sudo apt-get install -y gcc-multilib
23-
2419
- name: Install GCC ${{ matrix.gcc }}
2520
if: matrix.gcc != 'default'
2621
run: |
27-
sudo apt-get install -y gcc-${{ matrix.gcc }} gcc-${{ matrix.gcc }}-multilib
22+
sudo apt-get update
23+
sudo apt-get install -y gcc-${{ matrix.gcc }}
2824
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100
2925
3026
- name: Show GCC version
@@ -40,7 +36,7 @@ jobs:
4036
if: matrix.gcc == 'default'
4137
uses: actions/upload-artifact@v4
4238
with:
43-
name: c2asm370-linux-x86
39+
name: c2asm370-linux-amd64
4440
path: c2asm370
4541

4642
build-linux-arm64:
@@ -89,10 +85,10 @@ jobs:
8985
steps:
9086
- uses: actions/checkout@v4
9187

92-
- name: Download Linux x86 binary
88+
- name: Download Linux amd64 binary
9389
uses: actions/download-artifact@v4
9490
with:
95-
name: c2asm370-linux-x86
91+
name: c2asm370-linux-amd64
9692
path: release/linux
9793

9894
- name: Download Linux arm64 binary
@@ -112,7 +108,7 @@ jobs:
112108
chmod +x release/linux/c2asm370
113109
chmod +x release/linux-arm64/c2asm370
114110
chmod +x release/macos/c2asm370
115-
cd release/linux && tar czf ../../c2asm370-linux-x86.tar.gz c2asm370 && cd ../..
111+
cd release/linux && tar czf ../../c2asm370-linux-amd64.tar.gz c2asm370 && cd ../..
116112
cd release/linux-arm64 && tar czf ../../c2asm370-linux-arm64.tar.gz c2asm370 && cd ../..
117113
cd release/macos && tar czf ../../c2asm370-macos-arm64.tar.gz c2asm370 && cd ../..
118114
@@ -121,6 +117,6 @@ jobs:
121117
with:
122118
generate_release_notes: true
123119
files: |
124-
c2asm370-linux-x86.tar.gz
120+
c2asm370-linux-amd64.tar.gz
125121
c2asm370-linux-arm64.tar.gz
126122
c2asm370-macos-arm64.tar.gz

Makefile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 2023-12-29: This Makefile creates the "c2asm370" executable on and for Linux.
2-
# The resulting "c2asm370" is a 32 bit executable program that *should*
3-
# run on 32 or 64 bit Linux machines.
2+
# The resulting "c2asm370" is a native 64-bit executable
3+
# (x86-64 / aarch64). macOS (Apple Silicon) is also supported.
44
#
55
# When executing "c2asm370" you must use the '-S' option to create an
66
# assembler source file: ./c2asm370 -I pdpclib -S test.c
@@ -26,7 +26,6 @@ CC = gcc
2626

2727
# Platform detection
2828
UNAME_S := $(shell uname -s)
29-
UNAME_M := $(shell uname -m)
3029

3130
ifeq ($(UNAME_S),Darwin)
3231
# macOS (Apple Silicon or Intel)
@@ -35,23 +34,15 @@ ifeq ($(UNAME_S),Darwin)
3534
LINK_ARCH_FLAGS =
3635
LINK_LIBS =
3736
EXTRA_CFLAGS = -fcommon -fgnu89-inline
38-
else ifneq (,$(filter aarch64 arm64,$(UNAME_M)))
39-
# Linux on ARM64 — native 64-bit build.
40-
# There is no usable 32-bit multilib on ARM64, so we do not use -m32.
37+
else
38+
# Linux — native 64-bit build (x86-64 / aarch64).
4139
# The 64-bit host configuration is selected automatically via __LP64__
4240
# in gcc/config.h and gcc/auto-host.h (same path as the macOS build).
4341
HOST_DEFINE = -DHOST_LINUX
4442
ARCH_FLAGS =
4543
LINK_ARCH_FLAGS =
4644
LINK_LIBS = -lgcc
4745
EXTRA_CFLAGS =
48-
else
49-
# Linux on x86 (default, 32-bit build)
50-
HOST_DEFINE = -DHOST_LINUX
51-
ARCH_FLAGS = -m32 -fno-pie
52-
LINK_ARCH_FLAGS = -m32 -no-pie
53-
LINK_LIBS = -lgcc
54-
EXTRA_CFLAGS =
5546
endif
5647

5748
DEFINES = -DIN_GCC -DHAVE_CONFIG_H -DPUREISO -DTARGET_MVS $(HOST_DEFINE) -DMVSGCC_CROSS

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# c2asm370
22

3-
A C cross-compiler that produces IBM System/370 assembler source from C code. Built on a stripped-down GCC 3.2.3, it runs on Linux (x86 32-bit and ARM64) and macOS (including Apple Silicon) and generates mainframe-ready assembler output.
3+
A C cross-compiler that produces IBM System/370 assembler source from C code. Built on a stripped-down GCC 3.2.3, it runs as a native 64-bit binary on Linux (x86-64 and ARM64) and macOS (Apple Silicon) and generates mainframe-ready assembler output.
44

55
## Background
66

@@ -21,8 +21,7 @@ The generated output uses:
2121

2222
### Requirements
2323

24-
- **Linux (x86):** GCC with 32-bit support (`gcc-multilib`)
25-
- **Linux (ARM64):** GCC (native 64-bit build, no multilib needed)
24+
- **Linux (x86-64 / ARM64):** GCC (native 64-bit build, no multilib needed)
2625
- **macOS:** Xcode Command Line Tools (Apple Silicon and Intel supported)
2726
- GNU Make
2827

i370/version.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#include "ansidecl.h"
22
#include "version.h"
33

4-
const char *const version_string = "3.2.3 - c2asm370 version 1.3";
4+
const char *const version_string = "3.2.3 - c2asm370 version 1.4";

0 commit comments

Comments
 (0)