Skip to content

Commit eb9724d

Browse files
authored
Fix compatibility with musl libc 1.2.4 (#189)
1 parent 5ba82fa commit eb9724d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/test_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
config: ${{ fromJson(inputs.configuration) }}
121121
runs-on: ubuntu-latest
122122
container:
123-
image: "alpine:3.14"
123+
image: "alpine:3.21"
124124
options: --cpus 4 --workdir /github/workspace -v /home/runner/work/_temp:/home/runner/work/_temp
125125
timeout-minutes: 180
126126
steps:

ddprof-lib/src/main/cpp/symbols_linux.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
#include <sys/mman.h>
2525
#include <sys/stat.h>
2626
#include <sys/types.h>
27+
28+
// make sure lseek will use 64 bits offset
29+
#define _FILE_OFFSET_BITS 64
2730
#include <unistd.h>
2831

2932
ElfSection *ElfParser::findSection(uint32_t type, const char *name) {
@@ -68,7 +71,7 @@ bool ElfParser::parseFile(CodeCache *cc, const char *base,
6871
return false;
6972
}
7073

71-
size_t length = (size_t)lseek64(fd, 0, SEEK_END);
74+
size_t length = (size_t)lseek(fd, 0, SEEK_END);
7275
void *addr = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fd, 0);
7376
close(fd);
7477

0 commit comments

Comments
 (0)