mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 05:43:51 +02:00
+ enable weak externals for OpenBSD
* converted the reference to _init in si_dll to be a weak external. This way we can support creating shared libraries that link to the C library as well as libraries that do not. If libc was linked, the compiler will link in crtbeginS.o and crtendS.o; _init is defined in crtbeginS.o and initializes the C library and calls all the C static constructors. git-svn-id: trunk@41751 -
This commit is contained in:
parent
aad032f133
commit
52a5669117
@ -346,7 +346,7 @@ interface
|
||||
systems_indirect_entry_information = systems_darwin+[system_i386_win32,system_x86_64_win64,system_x86_64_linux];
|
||||
|
||||
{ all systems for which weak linking has been tested/is supported }
|
||||
systems_weak_linking = systems_darwin + systems_solaris + systems_linux + systems_android;
|
||||
systems_weak_linking = systems_darwin + systems_solaris + systems_linux + systems_android + systems_openbsd;
|
||||
|
||||
systems_internal_sysinit = [system_i386_win32,system_x86_64_win64,
|
||||
system_i386_linux,system_powerpc64_linux,system_sparc64_linux,system_x86_64_linux,
|
||||
|
@ -16,7 +16,11 @@
|
||||
|
||||
{$asmmode gas}
|
||||
|
||||
{$ifdef VER3_0}
|
||||
procedure _init; external name '_init';
|
||||
{$else VER3_0}
|
||||
procedure _init; weakexternal name '_init';
|
||||
{$endif VER3_0}
|
||||
|
||||
procedure _FPC_proc___start(argc: LongInt; argv: PPChar; envp: Pointer; para1, para2, para3: QWord); forward;
|
||||
|
||||
@ -61,7 +65,8 @@ procedure _FPC_proc___start(argc: LongInt; argv: PPChar; envp: Pointer; para1, p
|
||||
__progname_storage[I]:=#0;
|
||||
__progname:=@__progname_storage;
|
||||
end;
|
||||
_init;
|
||||
if Assigned(@_init) then
|
||||
_init;
|
||||
PascalMain;
|
||||
asm
|
||||
jmp _FPC_proc_haltproc@PLT
|
||||
|
Loading…
Reference in New Issue
Block a user