0x7fb34456fc2d
and the native function is 0x561b3c52a51b
given that you can print the functions location with "%p", funname
RTLD_DEEPBIND
which should place the symbols before global scope. And that now even breaks the error if i delete the shared object.Symbol references in the shared object are resolved using (in order): symbols in the link map of objects loaded for the main program and its dependencies; symbols in shared objects (and their depen‐ dencies) that were previously opened with dlopen() using the RTLD_GLOBAL flag; and definitions in the shared object itself (and any dependencies that were loaded for that object).
Bus error
xd never seen that one before./twmap-edit --mapdir input.map output-directory
to obtain the JSONs, PNGs, and OPUS files./twmap-edit --mapdir input.map output-directory
to obtain the JSONs, PNGs, and OPUS files #if
s are evil, better be careful with them. especially if they contain a struct definition :DUndefined symbols for architecture x86_64:
"_SDL_FlashWindow", referenced from:
CGraphicsBackend_SDL_GL::NotifyWindow() in backend_sdl.cpp.o
ld: symbol(s) not found for architecture x86_64
/Users/chillerdragon/Desktop/git/ddnet/src/engine/client/sound.cpp:506:3: error: use of undeclared identifier 'WavpackCloseFile'
__builtin_available
(and @available
for obj-c), and the entire "library" is built with availability annotations, if you build an executable targetting old macOS, any function that isn't available on that old version will be weakly linked. It's quite ergonomic
On Windows to achieve a similar effect you'll need to just resort to LoadLibrary
and hand resolving those symbols that might not exist and checking by hand on MSDN when they are available or notif(__builtin_available(macOS 13.0.1))
_invoke_trampoline:
# rdi <- fn_ptr: extern "C" fn()
# rsi <- args_ptr: *const u64
# rdx <- args_len: usize
# rcx <- ret_ptr: &mut [u64; 2]
push rbp # Push rbp (callee-saved).
push rcx # Push rcx (ret_ptr).
mov rbp, rsp # Store the current stack pointer.
sub rsp, 8 # Align the stack.
mov r10, rdi # We'll need rdi.
mov r11, rsi # We'll need rsi.
cmp rdx, 6 # Check if there are more than 6 arguments.
jbe 2f # If there are less than 6, skip to register arguments.
#
# Process stack arguments.
#
# Add padding to support an odd number of stack parameters.
mov rax, rdx
and rax, 1
lea rsp, [rsp + 8 * rax]
1:
dec rdx # Decrement length.
mov rax, [r11 + 8 * rdx] # Load the value.
push rax # Push it into the stack.
cmp rdx, 6 # Check if there are more than 6 arguments.
ja 1b # If there still are, loop back and repeat.
2:
#
# Process registers.
#
shl rdx, 2 # Multiply remaining length by 4.
lea rax, [rip + 3f] # Load the PC-relative address of `3f`.
sub rax, rdx # Subtract 4 * remaining_len (rdx).
jmp rax # Jump to the resulting address.
mov r9, [r11 + 0x28] # Load argument #6.
mov r8, [r11 + 0x20] # Load argument #5.
mov rcx, [r11 + 0x18] # Load argument #4.
mov rdx, [r11 + 0x10] # Load argument #3.
mov rsi, [r11 + 0x08] # Load argument #2.
nop # Note: The previous 5 `mov` instructions use 4 bytes each, but
# the last one only takes 3. This `nop` (1 byte) is used to
# align them all at 4 bytes so that the last jump instruction
# works correctly.
mov rdi, [r11] # Load argument #1.
3:
# Call the function.
call r10
mov rsp, rbp
pop rcx
pop rbp
# Store return registers.
mov [rcx], rax
mov [rcx + 8], rdx
ret
this is like our trampoline method to call a function with X amount of arguments_invoke_trampoline:
// x0 <- fn_ptr: extern "C" fn()
// x1 <- args_ptr: *const u64
// x2 <- args_len: usize
// x3 <- ret_ptr: &mut [u64; 4]
stp x29, x30, [sp, #-16]!
stp x19, x3, [sp, #-16]! // Necessary to restore the stack after the call.
mov x19, sp
mov x9, x0 // We'll need x0.
add x10, x1, x2, lsl 3 // Move the pointer to the end (past last element).
cmp x2, 8 // Check if there are more than 8 arguments.
ble 2f // If there are less than 8, skip to register arguments.
//
// Process stack arguments.
//
// Add padding to support an odd number of stack parameters.
and x0, x2, 1
sub x4, sp, x0, lsl 3 // ARM doesn't like `str reg, [sp]` instructions when
// the stack isn't 16-byte aligned (not just on `bl`).
1:
sub x2, x2, 1 // Decrement length.
ldr x3, [x10, #-8]! // Decrement pointer, then load the value.
str x3, [x4, #-8]! // Reserve stack memory, then write the value.
cmp x2, 8 // Check if there are more than 8 arguments.
bgt 1b // If there still are, loop back and repeat.
mov sp, x4
2:
//
// Process registers.
//
adr x0, 3f // Load address of label 3f.
sub x0, x0, x2, lsl 2 // Subtract 4 * n_args.
br x0 // Jump.
ldr x7, [x10, #-8]! // Decrement pointer, then load the value.
ldr x6, [x10, #-8]! // Decrement pointer, then load the value.
ldr x5, [x10, #-8]! // Decrement pointer, then load the value.
ldr x4, [x10, #-8]! // Decrement pointer, then load the value.
ldr x3, [x10, #-8]! // Decrement pointer, then load the value.
ldr x2, [x10, #-8]! // Decrement pointer, then load the value.
ldr x1, [x10, #-8]! // Decrement pointer, then load the value.
ldr x0, [x10, #-8]! // Decrement pointer, then load the value.
3:
// Call the function.
blr x9
// Restore the stack and context registers.
mov sp, x19
ldp x19, x4, [sp], 16
ldp x29, x30, [sp], 16
// Store the results into `ret_ptr`.
stp x0, x1, [x4], 16
stp x2, x3, [x4]
ret
IServer::ChangeMap
b2b0cd0
Fix shadowed variable declarations in android_main.cpp
- Robyt3
4a2a235
Fix integrity_save.txt
file not being closed - Robyt3
dfae99d
Fix unused variable Silent
in client.cpp
on Android - Robyt3
ad9b44b
Remove local.properties
and add it to .gitignore
- Robyt3
9afe744
Fix SDL3 being used in gen_libs.sh
- Robyt3
468cd85
Add build folder parameter to cmake_android.sh
- Robyt3
ceb1640
Fix incorrect CMake target name in cmake_android.sh
- Robyt3
b2c2a74
Remove unused shell script function arguments - Robyt3
cdbe1f7
Various fixes/improvements to Android building scripts - Robyt3
664b0e9
Upgrade Gradle and fix Android deprecation errors - Robyt3
51e4e41
Change tw.DDNet
package name to org.ddnet.client
- Robyt3
e4a7fd5
Determine default version name and code from version.h
- Robyt3
1316ac3
Improve the Android building README.md
- Robyt3
848f4a8
Merge pull request #8334 from Robyt3/Android-Building-Fix - heinrich5991