Build logs - https://gist.github.com/rallias/a8673987c419e8a0318f22b496a81fd1
Checking if "dlopen() and dlsym() in libdl" : links: YES
meson.build:860:2: ERROR: C shared or static library 'dl' not found
A full log can be found at /home/rallias/Dev2/serenity/Ports/glib/glib-2.70.0/_build/meson-logs/meson-log.txt
Running compile:
Working directory: /home/rallias/Dev2/serenity/Ports/glib/glib-2.70.0/_build/meson-private/tmpqzsrrdek
Command line: i686-pc-serenity-gcc /home/rallias/Dev2/serenity/Ports/glib/glib-2.70.0/_build/meson-private/tmpqzsrrdek/testfile.c -o /home/rallias/Dev2/serenity/Ports/glib/glib-2.70.0/_build/meson-private/tmpqzsrrdek/output.exe -D_FILE_OFFSET_BITS=64 -O0 -std=gnu99 -Wl,--start-group -ldl -Wl,--end-group
Code:
#include <dlfcn.h>
int glib_underscore_test (void) { return 42; }
int main (int argc, char ** argv) {
void *f1 = (void*)0, *f2 = (void*)0, *handle;
handle = dlopen ((void*)0, 0);
if (handle) {
f1 = dlsym (handle, "glib_underscore_test");
f2 = dlsym (handle, "_glib_underscore_test");
}
return (!f2 || f1);
}
Compiler stdout:
Compiler stderr:
Checking if "dlopen() and dlsym() in libdl" : links: YES
Running compile:
Working directory: /home/rallias/Dev2/serenity/Ports/glib/glib-2.70.0/_build/meson-private/tmpy663amqk
Command line: i686-pc-serenity-gcc /home/rallias/Dev2/serenity/Ports/glib/glib-2.70.0/_build/meson-private/tmpy663amqk/testfile.c -o /home/rallias/Dev2/serenity/Ports/glib/glib-2.70.0/_build/meson-private/tmpy663amqk/output.exe -D_FILE_OFFSET_BITS=64 -O0 -Wl,--start-group -ldl -Wl,--end-group -Wl,--allow-shlib-undefined
Code:
int main(void) { return 0; }
Compiler stdout:
Compiler stderr:
/home/rallias/Dev2/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: /home/rallias/Dev2/serenity/Ports/glib/glib-2.70.0/_build/meson-private/tmpy663amqk/output.exe: hidden symbol `__divdi3' in /home/rallias/Dev2/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/libgcc.a(_divdi3.o) is referenced by DSO
/home/rallias/Dev2/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
meson.build:860:2: ERROR: C shared or static library 'dl' not found
In the discord ports channel, BertalanD found the following patch allowed successful build:
index d23819291b..ec46171271 100755
--- a/Ports/glib/package.sh
+++ b/Ports/glib/package.sh
@@ -7,6 +7,7 @@ configopts=("--cross-file" "../cross_file-$SERENITY_ARCH.txt")
files="https://gitlab.gnome.org/GNOME/glib/-/archive/${version}/glib-${version}.tar.gz glib-${version}.tar.gz aadf815ed908d4cc14ac3976f325b986b4ab2b65ad85bc214ddf2e200648bd1c"
auth_type=sha256
+export LDFLAGS="-lgcc_s"
configure() {
run meson _build "${configopts[@]}"
}
Discussion ensued, ending in the following comment:
[6:34 PM] BertalanD: I guess we can try partially reverting this
[6:34 PM] BertalanD: 738e52d (edited)
[6:35 PM] BertalanD: only the AS_NEEDED part though. Setting -lgcc_s in LINK_SPEC is a dirty hax
It was suggested an issue be submitted, so in the name of posterity in all their majesty...
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too