error: undefined symbol ... during make
-
@elbnacht said in error: undefined symbol ... during make:
I thought, this will be done automatically when qmake creates the makefile and make doues the job
No, why should it? The lib is already built.
What I mean is: you need to get source code of that lib and compile it using the same tool chain you're using to compile your projects. -
Sorry, but I'm lost now. Please corect me:
The wdt_dio driver (its a hardware driver) is compiled using gcc ...
The WebAssembly project is using emsdk qmake / make ... using em++.Should I create a make file for the wdt_dio using em++ and compile ... it again?
-
@elbnacht said in error: undefined symbol ... during make:
Should I create a make file for the wdt_dio using em++ and compile ... it again?
You need to download the source code and then build it with em++. It should not be necessary to write makefile by yourself, but use whatever is used by wdt_dio project (check its source code).
-
Ok, found some more interesting websites about linking etc.
I started with a simple emcc wdt_dio.c ... created the error 'linux/module.h' file not found, which is beside other included in the .c file.
All linux sources are installed on my system ...
Could not find any compiler flags avoiding it ...But also for my basic understanding:
WebAssembly requires a different driver compiled with emcc/em++ for the emscription environment. Is that right? -
@elbnacht The libs you want to use with WebAssembly has to be compiled for WebAssembly. You can't use (as far as I know) libs compiled with GCC.
"emcc wdt_dio.c ... created the error 'linux/module.h'" - tell emcc where the headers are. -
@elbnacht said in error: undefined symbol ... during make:
WebAssembly requires a different driver compiled with emcc/em++ for the emscription environment. Is that right?
Very probably yes. And these can be missing at this point. WASM ecosystem is quite limited at this point.
Think about WebAssembly as a different operating system: libraries are not compatible, your system headers/libs won't work, you are essentially cross-compiling. Similar to deploying for an embedded board, except here the system is not Linux but a sandboxed web browser environment.
-
Many thanks for your explanation. This sounds much clearer for me.
I made a simple Makefile (to find the .h files). Output creates some errors:
===================================
infratec@debian:~/Qt-Projekte/driver$ make
make -C /lib/modules/4.19.0-8-amd64/build SUBDIRS=/home/infratec/Qt-Projekte/driver modules
make[1]: Verzeichnis "/usr/src/linux-headers-4.19.0-8-amd64" wird betreten
CC [M] /home/infratec/Qt-Projekte/driver/wdt_dio.o
clang: error: unknown argument: '-mno-fp-ret-in-387'
clang: error: unknown argument: '-mpreferred-stack-boundary=3'
clang: error: unknown argument: '-mskip-rax-setup'
clang: error: unknown argument: '-mindirect-branch=thunk-extern'
clang: error: unknown argument: '-mindirect-branch-register'
clang: error: unknown argument: '-fno-var-tracking-assignments'
clang: error: unknown argument: '-mrecord-mcount'
clang: error: unknown argument: '-fconserve-stack'
clang: error: unknown argument: '-fmacro-prefix-map=/usr/src/linux-headers-4.19.0-8-common/='
clang: error: unknown argument: '-fcf-protection=none'
clang: warning: optimization flag '-falign-jumps=1' is not supported [-Wignored-optimization-argument]
clang: warning: optimization flag '-falign-loops=1' is not supported [-Wignored-optimization-argument]
clang: warning: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Wignored-optimization-argument]
clang: warning: optimization flag '-fmerge-constants' is not supported [-Wignored-optimization-argument]
shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting
make[4]: *** [/usr/src/linux-headers-4.19.0-8-common/scripts/Makefile.build:315: /home/infratec/Qt-Projekte/driver/wdt_dio.o] Fehler 1
make[3]: *** [/usr/src/linux-headers-4.19.0-8-common/Makefile:1537: module/home/infratec/Qt-Projekte/driver] Fehler 2
make[2]: *** [Makefile:146: sub-make] Fehler 2
make[1]: *** [Makefile:8: all] Fehler 2
make[1]: Verzeichnis „/usr/src/linux-headers-4.19.0-8-amd64“ wird verlassen
make: *** [Makefile:17: all] Fehler 2===============================
Any idea on this?
-
-
Emscripten/wasm does not have access to the kernel, so trying to build kernel modules for wasm will not work. It lives in the web browser sandbox alongside javascript.