Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions amxmodx/AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ if builder.target_platform == 'mac':
binary.compiler.postlink += [
'-Wl,-read_only_relocs,suppress'
]
elif builder.target_platform == 'linux':
# Assembly objects built without -fPIC; binutils >= 2.40 errors on text relocations
binary.compiler.postlink += [
'-Wl,-z,notext'
]
elif builder.target_platform == 'windows':
binary.compiler.linkflags += [
'/EXPORT:GiveFnptrsToDll=_GiveFnptrsToDll@8,@1',
Expand Down
2 changes: 2 additions & 0 deletions compiler/libpc300/AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ binary.compiler.includes += [
if builder.target_platform in ['mac', 'linux']:
binary.compiler.defines += ['ENABLE_BINRELOC']
binary.compiler.postlink += ['-lm', '-lpthread']
# i386 sources compiled without -fPIC; binutils >= 2.40 errors on text relocations
binary.compiler.linkflags += ['-Wl,-z,notext']

binary.compiler.defines += [
'NO_MAIN',
Expand Down
6 changes: 4 additions & 2 deletions compiler/libpc300/prefix.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ br_strndup (char *str, size_t size)
char *
br_extract_dir (const char *path)
{
char *end, *result;
const char *end;
char *result;

br_return_val_if_fail (path != (char *) NULL, (char *) NULL);

Expand Down Expand Up @@ -428,7 +429,8 @@ br_extract_dir (const char *path)
char *
br_extract_prefix (const char *path)
{
char *end, *tmp, *result;
const char *end;
char *tmp, *result;

br_return_val_if_fail (path != (char *) NULL, (char *) NULL);

Expand Down
3 changes: 3 additions & 0 deletions modules/regex/AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ binary = AMXX.MetaModule(builder, 'regex')

if builder.target_platform == 'linux':
binary.compiler.postlink += [binary.Dep('lib_linux/libpcre.a')]
# lib_linux/libpcre.a was built without -fPIC; binutils >= 2.40 errors on
# text relocations in shared libs by default
binary.compiler.linkflags += ['-Wl,-z,notext']
elif builder.target_platform == 'mac':
binary.compiler.postlink += [binary.Dep('lib_darwin/libpcre.a')]
elif builder.target_platform == 'windows':
Expand Down
6 changes: 6 additions & 0 deletions modules/sqlite/AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ if builder.target_platform == 'linux' or builder.target_platform == 'mac':
binary.compiler.defines += ['stricmp=strcasecmp']
binary.compiler.postlink += ['-lpthread']

if builder.target_platform == 'linux':
# i386 .so; binutils >= 2.40 errors on text relocations
binary.compiler.postlink += ['-Wl,-z,notext']
# sqlite3.c (vendored amalgamation) triggers false-positive warnings in GCC 14+
binary.compiler.cflags += ['-Wno-misleading-indentation', '-Wno-return-local-addr']

binary.sources += [
'basic_sql.cpp',
'handles.cpp',
Expand Down