Skip to content

Commit

Permalink
debian build fix, +verbose "make check"
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-chumak committed Oct 28, 2024
1 parent 1976d61 commit 61e0f03
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 118 deletions.
9 changes: 9 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ export PATH := .:$(PATH)
$(shell mkdir -p config)
export OL_HOME=libraries

# don't spam "Entering/Leaving directory"
MAKEFLAGS += --no-print-directory

# default target
all: release

Expand All @@ -25,9 +28,15 @@ MGCC32 ?= i686-w64-mingw32-gcc
MGCC64?=x86_64-w64-mingw32-gcc

# ansi colors
ifeq ($(MAKE_TERMOUT),)
red=
green=
done=
else
red=\033[1;31m
green=\033[1;32m
done=\033[0m
endif

# check submodules
# ----------------
Expand Down
14 changes: 13 additions & 1 deletion debian/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ else
ppa:
git checkout debian/changelog
sed 's/UNRELEASED/$(UNRELEASED)/g' -i debian/changelog


git checkout debian/control
# fix fuxking debhelper-compact for fuxking ubuntu build system
test "$(UNRELEASED)" = "xenial" && sed -i '/debhelper-compat/c\Build-Depends: debhelper-compat (= 9)' debian/control; true

rm -f debian/files
dpkg-buildpackage -us -uc -ui -S -sd \
-rfakeroot
Expand All @@ -27,4 +31,12 @@ ppas:
done
git checkout debian/changelog

xenial:
UNRELEASED=xenial $(MAKE) ppa
git checkout debian/changelog

noble:
UNRELEASED=noble $(MAKE) ppa
git checkout debian/changelog

endif
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ol (2.6-UNRELEASED4) UNRELEASED; urgency=medium
ol (2.6-UNRELEASED5) UNRELEASED; urgency=medium

* 2.6

Expand Down
2 changes: 2 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/make -f
MAKEFLAGS += --no-print-directory

%:
dh $@ -O--no-parallel

override_dh_auto_test:
echo | gcc -dM -E -
dh_auto_test -O--no-parallel
1 change: 1 addition & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
tar-ignore = ".git"
tar-ignore = ".vscode"
tar-ignore = ".github"
tar-ignore = "examples"
tar-ignore = "jni"
tar-ignore = "samples"
6 changes: 3 additions & 3 deletions doc/reference/bytevectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Bytevectors are written using the notation `#u8(...)` and function `bytevector`.
=== #u8(0 1 2 127 128 255)
; all values wider than 8 bits will be truncated
(bytevector 254 255 256 257 258 7778885551232190)
(bytevector 254 255 256 257 258 53659306755069118)
==> #u8(254 255 0 1 2 190)
```
Expand Down Expand Up @@ -86,8 +86,8 @@ Returns the length of bytevector *bv* in bytes as an exact integer.
(bytevector-length #u8()) ==> 0
(bytevector-length #u8(1 2 3))
==> 3
(bytevector-length (make-bytevector 1000000))
==> 1000000
(bytevector-length (make-bytevector 100000))
==> 100000
```

# bytevector-u8-ref
Expand Down
45 changes: 24 additions & 21 deletions extensions/ffi.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ ret_t win64_call(word argv[], long argc, void* function, long type);
// edx - argc
// r8 - function
// r9d - type
__ASM__("win64_call:_win64_call:", // "int $3",
__ASM__("win64_call:", "_win64_call:", // "int $3",
"pushq %rbp",
"movq %rsp, %rbp",

Expand Down Expand Up @@ -327,11 +327,14 @@ __ASM__("win64_call:_win64_call:", // "int $3",
"movsd %xmm0, (%rsp)",
"pop %rax", // можно попать, так как уже пушнули один r9 вверху (оптимизация)
"jmp 9b");
# endif

# else // System V (unix, linux, osx)
ret_t nix64_call(word argv[], double ad[], long i, long d, long mask, void* function, long type);
# if __unix__ || __linux__ || __APPLE__ // System V (unix, linux, osx)
static __attribute((__naked__))
ret_t nix64_call(word argv[], double ad[], long i, long d, long mask, void* function, long type)
// rdi rsi edx ecx r8 r9 16(rbp)
__ASM__("nix64_call:_nix64_call:", //"int $3",
{
__ASM__(//"int $3",
"pushq %rbp",
"movq %rsp, %rbp",

Expand Down Expand Up @@ -429,6 +432,7 @@ __ASM__("nix64_call:_nix64_call:", //"int $3",
"movsd %xmm0, (%rsp)",
"popq %rax", // corresponded push not required (we already pushed %r9)
"jmp 9b");
}

// RDI, RSI, RDX, RCX (R10 in the Linux kernel interface[17]:124), R8, and R9
// while XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 and XMM7 are used for floats
Expand All @@ -455,7 +459,7 @@ __ASM__("nix64_call:_nix64_call:", //"int $3",
//
ret_t x86_call(word argv[], long i, void* function, long type);
// all variables are in stack
__ASM__("x86_call:_x86_call:", //"int $3",
__ASM__("x86_call:", "_x86_call:", //"int $3",
"pushl %ebp",
"movl %esp, %ebp",

Expand Down Expand Up @@ -511,9 +515,12 @@ __ASM__("x86_call:_x86_call:", //"int $3",
// don't use r16, r17, r18
// don't forget "sudo DevToolsSecurity -enable" when debugging with lldb
// mask is deprecated, todo: remove
// "static __attribute((__naked__))"" is unsupported, so
ret_t arm64_call(word argv[], double ad[], long i, long d, char* extra, void* function, long type, long e);
// x0 x1 x2 x3 x4 x5 x6 x7
__ASM__("arm64_call:", "_arm64_call:", // "brk #0",
// x0 x1 x2 x3 x4 x5 x6 x7
__ASM__(
".global arm64_call");
__ASM__("arm64_call:", "_arm64_call", // "brk #0",
"stp x29, x30, [sp, -16]!", // fp + lr
"stp x10, x26, [sp, -16]!",
"mov x29, sp",
Expand Down Expand Up @@ -589,9 +596,7 @@ __ASM__("arm64_call:", "_arm64_call:", // "brk #0",
"b 0b",
"7:", // double (8)
"str d0, [sp]",
"b 0b"
);

"b 0b");

// ------------------------------------------
#elif __arm__
Expand Down Expand Up @@ -2776,20 +2781,17 @@ word* OLVM_ffi(olvm_t* this, word arguments)
#if __x86_64__
# if _WIN64
got = win64_call(args, i, function, returntype & 0x3F);
# else // (__unix__ || __APPLE__)
# endif
# if __unix__ || __linux__ || __APPLE__ // System V (unix, linux, osx)
got = nix64_call(args, ad, max(i, l), d, fpmask, function, returntype & 0x3F);
# endif

#elif __i386__
# if _WIN32
// cdecl and stdcall in our case are same, so...
got = x86_call(args, i, function, returntype & 0x3F);
# else // (__unix__ || __APPLE__)
got = x86_call(args, i, function, returntype & 0x3F);
# endif

#elif __aarch64__
got = arm64_call(args, ad, i, d, extra, function, returntype & 0x3F, WALIGN(e));
got = arm64_call(args, ad, i, d, extra, function, returntype & 0x3F, WALIGN(e));

#elif __arm__
// arm calling abi http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf
Expand All @@ -2802,16 +2804,17 @@ word* OLVM_ffi(olvm_t* this, word arguments)
# endif

#elif __mips__
got = mips32_call(args, i, function, returntype & 0x3F);
got = mips32_call(args, i, function, returntype & 0x3F);

#elif __EMSCRIPTEN__
got = asmjs_call(args, fpmask, function, returntype & 0x3F);
got = asmjs_call(args, fpmask, function, returntype & 0x3F);

#elif __sparc64__
got = call_x(args, i, function, returntype & 0x3F);
got = call_x(args, i, function, returntype & 0x3F);

#else // ALL other
got = call_x(args, i, function, returntype & 0x3F);
got = call_x(args, i, function, returntype & 0x3F);

/* inline ret_t call_cdecl(word args[], int i, void* function, int type) {
CALL(__cdecl);
}
Expand All @@ -2836,7 +2839,7 @@ word* OLVM_ffi(olvm_t* this, word arguments)
break;
}*/
#endif
else
else // just mirror argument
got = *(ret_t *)args;

// где гарантия, что C и B не поменялись?
Expand Down
33 changes: 0 additions & 33 deletions extras/Makefile~

This file was deleted.

Loading

0 comments on commit 61e0f03

Please sign in to comment.