Skip to content
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

Make GCC/MinGW builds works on Linux #42

Closed
dontech opened this issue Oct 1, 2023 · 8 comments
Closed

Make GCC/MinGW builds works on Linux #42

dontech opened this issue Oct 1, 2023 · 8 comments
Labels
Build build scripts, VS project files, etc enhancement

Comments

@dontech
Copy link
Collaborator

dontech commented Oct 1, 2023

@tormodvolden mentioned this: #36

Test scenario: build tools and driver on Linux (debian or fedora based), and make the output work in win10/win11

@dontech
Copy link
Collaborator Author

dontech commented Oct 1, 2023

Inspiration from here: https://github.com/utoni/mingw-w64-dpp

@dontech
Copy link
Collaborator Author

dontech commented Oct 1, 2023

@tormodvolden what recipe or command line options do you use to test build on debian?

@tormodvolden
Copy link
Contributor

tormodvolden commented Oct 1, 2023

make host_prefix=x86_64-w64-mingw32 ddk=/usr/x86_64-w64-mingw32 driver V=1

@tormodvolden
Copy link
Contributor

tormodvolden commented Oct 1, 2023

Just for reference, these are the build flags that get applied when building mingw-w64-dpp. I haven't checked that the dpp examples actually load on Windows though.

make -C examples DPP_ROOT=/home/tormod/SRC/mingw-w64-dpp all
make[1]: Entering directory '/home/tormod/SRC/mingw-w64-dpp/examples'
/usr/bin/x86_64-w64-mingw32-gcc -std=c99 -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing -m64 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-builtin -ffreestanding -fno-stack-protector -mno-stack-arg-probe -I/home/tormod/SRC/mingw-w64-dpp/CRT -I/usr/x86_64-w64-mingw32/include/ddk -D__INTRINSIC_DEFINED_InterlockedBitTestAndSet -D__INTRINSIC_DEFINED_InterlockedBitTestAndReset -c dpp-example.c -o dpp-example.o
CC dpp-example.o
/usr/bin/x86_64-w64-mingw32-gcc -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing -m64 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-builtin -ffreestanding -fno-stack-protector -mno-stack-arg-probe -I/home/tormod/SRC/mingw-w64-dpp/CRT -I/usr/x86_64-w64-mingw32/include/ddk -D__INTRINSIC_DEFINED_InterlockedBitTestAndSet -D__INTRINSIC_DEFINED_InterlockedBitTestAndReset -shared -Wl,--subsystem,native -Wl,--image-base,0x140000000 -Wl,--dynamicbase -Wl,--nxcompat -Wl,--file-alignment,0x200 -Wl,--section-alignment,0x1000 -Wl,--stack,0x100000 -Wl,--gc-sections -Wl,--exclude-all-symbols -Wl,--entry,_CRT_DriverEntry -nostartfiles -nodefaultlibs -nostdlib -Wl,-Map='dpp-example.sys.map' -o 'dpp-example.sys' dpp-example.o /home/tormod/SRC/mingw-w64-dpp/CRT-build/libcrt.a -lntoskrnl -lhal
LD dpp-example.sys

@mcuee mcuee added enhancement Build build scripts, VS project files, etc labels Oct 2, 2023
@dontech
Copy link
Collaborator Author

dontech commented Jan 7, 2024

The system event viewer says this in "application popup" message:

libusb0.sys cannot find usbd.sys _USBD_CreateConfigurationRequestEx

Notice the underscore. Removing "--add-underscore" fixes the problem.

FIXED.

@dontech
Copy link
Collaborator Author

dontech commented Jan 7, 2024

04dde53

@dontech
Copy link
Collaborator Author

dontech commented Jan 7, 2024

@tormodvolden please verify

@dontech dontech closed this as completed Jan 7, 2024
@tormodvolden
Copy link
Contributor

@tormodvolden please verify

Yes! I can confirm this works! Great!

And thanks for the System Event Viewer clue. I hadn't looked in there (and I don't know if I would take notice of that extra underscore...).

Now just sad that the usbdex thing complicates it all...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build build scripts, VS project files, etc enhancement
Projects
None yet
Development

No branches or pull requests

3 participants