mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-18 01:05:24 +01:00
Add new step mes-libc-patched
This commit is contained in:
parent
85ead5582e
commit
7c90d5bf4c
3 changed files with 55 additions and 7 deletions
14
sysa/tcc-0.9.27/mes-libc-patched.kaem
Executable file
14
sysa/tcc-0.9.27/mes-libc-patched.kaem
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
cd src/mes-libc
|
||||
|
||||
# Patch
|
||||
patch -Np0 -i ../../patches/mes-libc-qsort.patch
|
||||
|
||||
# Recompile libc
|
||||
cd ../tcc-0.9.27
|
||||
kaem --file ../../compile-libc.kaem
|
||||
|
||||
cd ../..
|
||||
29
sysa/tcc-0.9.27/patches/mes-libc-qsort.patch
Normal file
29
sysa/tcc-0.9.27/patches/mes-libc-qsort.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
--- lib/stdlib/qsort.c
|
||||
+++ lib/stdlib/qsort.c
|
||||
@@ -1,6 +1,7 @@
|
||||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
+ * Copyright © 2021 Paul Dersey <pdersey@gmail.com>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
@@ -24,10 +25,14 @@
|
||||
void
|
||||
qswap (void *a, void *b, size_t size)
|
||||
{
|
||||
- char *buf[8];
|
||||
- memcpy (buf, a, size);
|
||||
- memcpy (a, b, size);
|
||||
- memcpy (b, buf, size);
|
||||
+ char *pa = a;
|
||||
+ char *pb = b;
|
||||
+ do
|
||||
+ {
|
||||
+ char tmp = *pa;
|
||||
+ *pa++ = *pb;
|
||||
+ *pb++ = tmp;
|
||||
+ } while (--size > 0);
|
||||
}
|
||||
|
||||
size_t
|
||||
Loading…
Add table
Add a link
Reference in a new issue