Update to rgbds-0.7.0.

This commit is contained in:
bentley
2024-04-16 16:36:49 +00:00
parent 1d2995248b
commit bba5576a70
9 changed files with 67 additions and 73 deletions
+1 -2
View File
@@ -2,9 +2,8 @@ FIX_EXTRACT_PERMISSIONS = Yes
COMMENT = Game Boy development system
V = 0.6.1
V = 0.7.0
DISTNAME = rgbds-$V
REVISION = 0
CATEGORIES = devel
+2 -2
View File
@@ -1,2 +1,2 @@
SHA256 (rgbds-0.6.1.tar.gz) = hyAYUJxsvC2elHoabVCf2dxWoBCCf2CMX0+kbeL6GGo=
SIZE (rgbds-0.6.1.tar.gz) = 8040703
SHA256 (rgbds-0.7.0.tar.gz) = s+K65D5nlJLv1vEo3G6VHdSxue91kF35N6m5+me8+vI=
SIZE (rgbds-0.7.0.tar.gz) = 8052126
+4 -4
View File
@@ -9,10 +9,10 @@ https://marc.info/?l=openbsd-bugs&m=157758838031146&w=2
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -42,7 +42,7 @@ CXXFLAGS ?= -O3 -flto -DNDEBUG
REALCFLAGS := ${CFLAGS} ${WARNFLAGS} -std=gnu11 -I include \
-D_POSIX_C_SOURCE=200809L -D_ISOC11_SOURCE
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} -std=c++17 -I include \
@@ -32,7 +32,7 @@ WARNFLAGS := -Wall -Wno-unknown-warning-option -Wno-c9
CXXFLAGS ?= -O3 -flto -DNDEBUG
# Non-overridable CXXFLAGS
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} -std=c++2a -I include \
- -D_POSIX_C_SOURCE=200809L -fno-exceptions -fno-rtti
+ -fno-exceptions -fno-rtti
# Overridable LDFLAGS
@@ -1,8 +1,8 @@
Index: src/asm/main.c
--- src/asm/main.c.orig
+++ src/asm/main.c
@@ -49,6 +49,8 @@
char const *__asan_default_options(void) { return "detect_leaks=0"; }
Index: src/asm/main.cpp
--- src/asm/main.cpp.orig
+++ src/asm/main.cpp
@@ -46,6 +46,8 @@ char const *__asan_default_options(void) { return "det
}
#endif
+int pledge(const char *, const char *);
@@ -10,12 +10,13 @@ Index: src/asm/main.c
// Old Bison versions (confirmed for 2.3) do not forward-declare `yyparse` in the generated header
// Unfortunately, macOS still ships 2.3, which is from 2008...
int yyparse(void);
@@ -148,6 +150,8 @@ static void print_usage(void)
@@ -146,6 +148,9 @@ static void printUsage(void)
int main(int argc, char *argv[])
{
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ fatalerror("pledge");
+ err("pledge");
+
time_t now = time(NULL);
char const *sourceDateEpoch = getenv("SOURCE_DATE_EPOCH");
-30
View File
@@ -1,30 +0,0 @@
Index: src/fix/main.c
--- src/fix/main.c.orig
+++ src/fix/main.c
@@ -21,6 +21,7 @@
#include "extern/getopt.h"
+#include "error.h"
#include "helpers.h"
#include "platform.h"
#include "version.h"
@@ -62,6 +63,8 @@ static struct option const longopts[] = {
{ NULL, no_argument, NULL, 0 }
};
+int pledge(const char *, const char *);
+
static void printUsage(void)
{
fputs(
@@ -1221,6 +1224,9 @@ int main(int argc, char *argv[])
{
nbErrors = 0;
int ch;
+
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err("pledge");
while ((ch = musl_getopt_long_only(argc, argv, optstring, longopts, NULL)) != -1) {
switch (ch) {
@@ -0,0 +1,24 @@
Index: src/fix/main.cpp
--- src/fix/main.cpp.orig
+++ src/fix/main.cpp
@@ -56,6 +56,8 @@ static struct option const longopts[] = {
{ NULL, no_argument, NULL, 0 }
};
+int pledge(const char *, const char *);
+
static void printUsage(void)
{
fputs(
@@ -1221,6 +1223,11 @@ finish:
int main(int argc, char *argv[])
{
nbErrors = 0;
+
+ if (pledge("stdio rpath wpath cpath", NULL) == -1) {
+ fprintf(stderr, "pledge");
+ return 1;
+ }
for (int ch; (ch = musl_getopt_long_only(argc, argv, optstring, longopts, NULL)) != -1;) {
switch (ch) {
+6 -6
View File
@@ -1,24 +1,24 @@
Index: src/gfx/main.cpp
--- src/gfx/main.cpp.orig
+++ src/gfx/main.cpp
@@ -138,6 +138,8 @@ static struct option const longopts[] = {
@@ -143,6 +143,8 @@ static struct option const longopts[] = {
{NULL, no_argument, NULL, 0 }
};
+int pledge(const char *, const char *);
+
static void printUsage(void) {
fputs("Usage: rgbgfx [-r stride] [-CmuVZ] [-v [-v ...]] [-a <attr_map> | -A]\n"
fputs("Usage: rgbgfx [-r stride] [-CmOuVZ] [-v [-v ...]] [-a <attr_map> | -A]\n"
" [-b <base_ids>] [-c <colors>] [-d <depth>] [-L <slice>] [-N <nb_tiles>]\n"
@@ -581,6 +583,11 @@ static char *parseArgv(int argc, char **argv, bool &au
@@ -589,6 +591,11 @@ static char *parseArgv(int argc, char **argv) {
}
int main(int argc, char *argv[]) {
bool autoAttrmap = false, autoTilemap = false, autoPalettes = false, autoPalmap = false;
+
+ if (pledge("stdio rpath wpath cpath", NULL) == -1) {
+ fputs("pledge", stderr);
+ exit(1);
+ }
+
struct AtFileStackEntry {
int parentInd; // Saved offset into parent argv
std::vector<char *> argv; // This context's arg pointer vec
-22
View File
@@ -1,22 +0,0 @@
Index: src/link/main.c
--- src/link/main.c.orig
+++ src/link/main.c
@@ -167,6 +167,8 @@ FILE *openFile(char const *fileName, char const *mode)
// Short options
static const char *optstring = "dl:m:Mn:O:o:p:S:s:tVvWwx";
+int pledge(const char *, const char *);
+
/*
* Equivalent long options
* Please keep in the same order as short opts
@@ -359,6 +361,9 @@ int main(int argc, char *argv[])
int optionChar;
char *endptr; // For error checking with `strtoul`
unsigned long value; // For storing `strtoul`'s return value
+
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err("pledge");
// Parse options
while ((optionChar = musl_getopt_long_only(argc, argv, optstring,
@@ -0,0 +1,22 @@
Index: src/link/main.cpp
--- src/link/main.cpp.orig
+++ src/link/main.cpp
@@ -161,6 +161,8 @@ FILE *openFile(char const *fileName, char const *mode)
return file;
}
+int pledge(const char *, const char *);
+
// Short options
static const char *optstring = "dl:m:Mn:O:o:p:S:s:tVvWwx";
@@ -353,6 +355,9 @@ next:
int main(int argc, char *argv[])
{
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err("pledge");
+
// Parse options
for (int ch; (ch = musl_getopt_long_only(argc, argv, optstring, longopts, NULL)) != -1;) {
switch (ch) {