Skip to content

Update Makefile #416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update Makefile #416

wants to merge 1 commit into from

Conversation

dobby33
Copy link

@dobby33 dobby33 commented Jun 5, 2025

After enabling CONFIG_WIN32 at line 35 in Makefile, command make still failing with such message:

C:/w64devkit/bin/ld.exe: cannot find -ldl: No such file or directory

@nickva
Copy link
Contributor

nickva commented Jun 5, 2025

I had never tried w64devkit but on windows I compile it with Msys2 like in the CI step:

with:
msystem: UCRT64
update: true
install: git make mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-dlfcn
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y

Another alternative is to cross-compile on Linux for Windows:

- name: Install MinGW and Wine
run: |
sudo apt install -y wine mingw-w64
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll .
- name: Setup Wine
run: |
wine --version
winecfg /v
# binfmt doesn't work in GitHub Actions
#sudo apt install -y binfmt-support wine-binfmt
#echo ":Wine:M::MZ::/usr/bin/wine:" > /etc/binfmt.d/wine.conf
#sudo systemctl restart systemd-binfmt
- name: Build
run: |
make CONFIG_WIN32=y

@dobby33
Copy link
Author

dobby33 commented Jun 5, 2025

ld --version
GNU ld (GNU Binutils) 2.44

echo $W64DEVKIT
2.2.0

According to

make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
variable CONFIG_WIN32 didn't applied.

According to

runs-on: ubuntu-latest
assuming
make CONFIG_WIN32=y
ran under Linux where -ldl parameter make sense.

@nickva
Copy link
Contributor

nickva commented Jun 6, 2025

In the msys2 environment on windows the mingw-w64-ucrt-x86_64-dlfcn package provides the runtime dynamic library loading. It's a separate package that has to be installed.

@dobby33
Copy link
Author

dobby33 commented Jun 6, 2025

In the msys2 environment on windows the mingw-w64-ucrt-x86_64-dlfcn package provides the runtime dynamic library loading. It's a separate package that has to be installed.

I suspected that this was the case.

Although my assumption was incorrect. Using MSYS2 does apply CONFIG_WIN32.

quickjs/Makefile

Lines 88 to 89 in 638ec8c

else ifdef MSYSTEM
CONFIG_WIN32=y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants