Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building AMX Mod X on modern Linux toolchains (GCC 14 + binutils 2.40+) fails with five distinct errors. GCC 14 tightened several diagnostics to hard errors, and binutils 2.40 made
--error-rwx-segmentsthe default, turning text relocations in shared libraries into linker errors (the same issue macOS already handles via-Wl,-read_only_relocs,suppress).Fixes
compiler/libpc300/prefix.c — declare
endasconst char *inbr_extract_dir()andbr_extract_prefix().strrchr()returnsconst char *when its input isconst char *; GCC 14 promotes-Wdiscarded-qualifiersto an error.compiler/libpc300/AMBuilder — add
-Wl,-z,notexton Linux. The i386 sources are compiled without-fPIC; binutils ≥ 2.40 made--error-rwx-segmentsthe default, causing the link to fail with text relocation errors.amxmodx/AMBuilder — add an
elif builder.target_platform == 'linux'block with-Wl,-z,notext. The macOS branch already uses-Wl,-read_only_relocs,suppressfor the same reason; Linux now needs the equivalent.modules/regex/AMBuilder — add
-Wl,-z,notexton Linux when linking the pre-builtlib_linux/libpcre.a, which was built without-fPICand therefore contains text relocations that binutils ≥ 2.40 rejects.modules/sqlite/AMBuilder — add
-Wl,-z,notexton Linux and suppress-Wno-misleading-indentation -Wno-return-local-addrinbinary.compiler.cflags. These are false-positive warnings triggered by the vendored SQLite amalgamation (third_party/sqlite/sqlite3.c) under GCC 14.Tested on
Gentoo Linux, GCC 14, binutils 2.46, targeting i386.