Skip to content

Commit

Permalink
Merge pull request #48 from fitzsim/ppc64-debian-fixes-1
Browse files Browse the repository at this point in the history
PPC64 Debian fixes
  • Loading branch information
DualBrain authored Oct 13, 2023
2 parents 53784f5 + 7ad1aac commit c7fd3bb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
1 change: 0 additions & 1 deletion internal/c/makedat_lnx32.txt

This file was deleted.

3 changes: 0 additions & 3 deletions internal/c/makedat_lnx64.txt

This file was deleted.

2 changes: 1 addition & 1 deletion internal/c/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#error "Unknown system; refusing to build. Edit os.h if needed"
#endif

#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined(QB64_MACOSX) || defined(__aarch64__)
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(QB64_MACOSX) || defined(__aarch64__)
#define QB64_64
#else
#define QB64_32
Expand Down
27 changes: 24 additions & 3 deletions source/qb64.bas
Original file line number Diff line number Diff line change
Expand Up @@ -13123,9 +13123,30 @@ IF os$ = "LNX" THEN

IF inline_DATA = 0 THEN
IF DataOffset THEN
IF INSTR(_OS$, "[32BIT]") THEN b$ = "32" ELSE b$ = "64"
OPEN ".\internal\c\makedat_lnx" + b$ + ".txt" FOR BINARY AS #150: LINE INPUT #150, a$: CLOSE #150
a$ = a$ + " " + tmpdir2$ + "data.bin " + tmpdir2$ + "data.o"
SHELL _HIDE "ld --verbose >internal/temp/ld-output.txt"
OPEN "internal/temp/ld-output.txt" FOR BINARY AS #150
DO UNTIL EOF(150)
LINE INPUT #150, a$
IF LEN(a$) THEN
s$ = "OUTPUT_FORMAT(" + CHR$(34)
x1 = INSTR(a$, s$)
IF x1 THEN
x1 = x1 + LEN(s$)
x2 = INSTR(x1, a$, CHR$(34))
format$ = MID$(a$, x1, x2 - x1)
ELSE
s$ = "OUTPUT_ARCH("
x1 = INSTR(a$, s$)
IF x1 THEN
x1 = x1 + LEN(s$)
x2 = INSTR(x1, a$, ")")
architecture$ = MID$(a$, x1, x2 - x1)
END IF
END IF
END IF
LOOP
CLOSE #150
a$ = "objcopy -Ibinary -O" + format$ + " -B" + architecture$ + " " + tmpdir2$ + "data.bin " + tmpdir2$ + "data.o"
CHDIR ".\internal\c"
SHELL _HIDE a$ + " 2>> ../../" + compilelog$
CHDIR "..\.."
Expand Down

0 comments on commit c7fd3bb

Please sign in to comment.