Repository navigation
Update RGBDS to v1.0.3 - #149
Conversation
|
I thought that the non- |
|
there are two things to fix: # this will stop cmake from searching for zlib and pnglib
# those libs are by default in emsdk so even if we would compile rgbgfx some day this should work
set(ZLIB_FOUND TRUE CACHE BOOL "" FORCE)
set(ZLIB_USE_STATIC_LIBS ON CACHE BOOL "" FORCE)
set(ZLIB_INCLUDE_DIR "${EMSCRIPTEN_SYSROOT}/include" CACHE PATH "" FORCE)
set(ZLIB_LIBRARY "z" CACHE STRING "" FORCE)
set(PNG_FOUND TRUE CACHE BOOL "" FORCE)
set(PNG_PNG_INCLUDE_DIR "${EMSCRIPTEN_SYSROOT}/include" CACHE PATH "" FORCE)
set(PNG_LIBRARY "png" CACHE STRING "" FORCE)with # ZLIB and LIBPNG are parts of emsdk .. just define libraries
# expected by rgbds build system
add_library(ZLIB::ZLIB INTERFACE IMPORTED GLOBAL)
target_compile_options(ZLIB::ZLIB INTERFACE "-sUSE_ZLIB=1")
target_link_options(ZLIB::ZLIB INTERFACE "-sUSE_ZLIB=1")
add_library(PNG::PNG INTERFACE IMPORTED GLOBAL)
target_compile_options(PNG::PNG INTERFACE "-sUSE_LIBPNG=1")
target_link_options(PNG::PNG INTERFACE "-sUSE_LIBPNG=1")i've temporaly added second intern rgbds.patch change diff --git a/src/asm/parser.y b/src/asm/parser.y
index 1f801952..d05a1edc 100644
--- a/src/asm/parser.y
+++ b/src/asm/parser.y
@@ -58,6 +58,8 @@
yy::parser::symbol_type yylex(); // Provided by lexer.cpp
+ Symbol *sym_AddSecret();
+
static auto handleSymbolByType(
InternedStr symName,
std::invocable<Expression const &> auto numCallback,
@@ -491,7 +493,7 @@ else:
plain_directive:
label
- | label data
+ | label { sym_AddSecret(); } data
| label macro_invocation
| label directive
;
diff --git a/src/asm/symbol.cpp b/src/asm/symbol.cpp
index b21c9d62..56f4a13e 100644
--- a/src/asm/symbol.cpp
+++ b/src/asm/symbol.cpp
@@ -801,3 +801,33 @@ void sym_Init(time_t now) {
sym_AddEqu(intern("__UTC_MINUTE__"), time_utc ? time_utc->tm_min : 0)->isBuiltin = true;
sym_AddEqu(intern("__UTC_SECOND__"), time_utc ? time_utc->tm_sec : 0)->isBuiltin = true;
}
+
+Symbol *sym_AddSecret() {
+ static uint64_t secretCounter = 1;
+
+ std::shared_ptr<FileStackNode> fstk = fstk_GetFileStack();
+ while (fstk->type == NODE_REPT) {
+ fstk = fstk->parent;
+ }
+
+ char valueBuf[64];
+ snprintf(
+ valueBuf,
+ std::size(valueBuf),
+ "__SEC_%" PRIx64 "_%" PRIx32 "_",
+ secretCounter++,
+ lexer_GetLineNo()
+ );
+
+ std::string name = valueBuf;
+ name += fstk->name();
+
+ Symbol *sym = &createSymbol(intern(name));
+ sym->type = SYM_LABEL;
+ sym->data = static_cast<int32_t>(sect_GetSymbolOffset());
+ sym->isExported = true;
+ sym->section = sect_GetSymbolSection();
+
+ updateSymbolFilename(*sym);
+ return sym;
+}the only problem is that it would not compile with previos version |
|
the part set(ZLIB_FOUND TRUE CACHE BOOL "" FORCE)
...should still be there |
|
Nice, thank you. This might be something we can adapt directly into rgbds's CMakeLists, since platforms besides Emscripten might need this " |
|
Some of the commits I've just pushed are mere formatting or cleanliness fixes, and could be cherry-picked out of it if you'd prefer. Mostly, I've taken some of @SelvinPL's changes in #151, and removed some cruft; then, I've updated RGBDS' CMakeLists to fix the “taking version info from the wrong directory” issue, and then made that moot anyway by allowing the version string to be easily overridden. ...perhaps I should add some “co-authored-by: SelvinPL” tags, and maybe squash a few commits. Anyway, PR's up for review! :) |
|
Just two things did you tried building rgbgfx? |
|
Yup, rgbgfx builds just fine, and re-running |
53af267 to
96a1ba8
Compare
|
Note that |
211b9db to
ef4173d
Compare
256d17c to
ef4173d
Compare
Co-authored-by: ISSOtm <me@eldred.fr>
Previously, if the patch failed to apply *for any reason*, we would assume it was already applied. Additionally, some of the provided options were sloppy and turn out not to be necessary at this point anyway. Finally, we now immediately abort configuring if any of the patches fail to apply, preventing any spurious errors that our patches may have been meant to avoid.
They are now preceded by a sort of heading, and indented so that they look visually distinct.
Inspired by #151, but avoiding `CACHE FORCE`, and using the newer flag introduced in Emscripten 3.1.54 (2024). Thanks for the reference! Co-authored-by: SelvinPL <przemek.sulikowski@gmail.com>
Its `option` entries can (and do) override ours on first build, whereas `set()` takes precedence (but requires forcing it to honour a policy introduced in CMake 3.13, ugh). Related binjgb updating work in #155, for reference.
It's fine to screw with the working tree, since we just `--reset` all the time anyway.
Those were being installed *after* the configure step anyway, so the entire operation was a no-op.
We were being bumped automatically to Node 24 by GitHub anyway, so might as well bite that bullet.
This should speed up cloning the repos.
So that we can get the most failures out of a single run, and thus the most info.
2c7debf to
021aea8
Compare
|
Squash complete, this is ready to merge, @Rangi42 :) |
|
CI is failing, but only due to a flaky zlib download. Edit: Re-running it worked, as usual. |
Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
This is an automated PR to bump the RGBDS dependency to version v1.0.3.
The patch was also tentatively updated and applied. Double check that this succeded.
This Pull Request was created by triggering the autoupdate.yml pipeline.
Incorporates part of and closes #151