I try to execute fakeroot debian/rules binary-headers binary-genericand compile when building kernel but get the error.
Here error in below
arch/x86/built-in.o:(.rodata+0x1cb8): undefined reference to 'sys_monlak'
make[2]: *** [vmlinux] Error 1
make[2]: Leaving directory '/home/su/linux-lts-vivid-3.19.0/debian/build/build-generic'
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/home/su/linux-lts-vivid-3.19.0'
make: *** [/home/su/linux-lts-vivid-3.19.0/debian/stamps/stamp-build-generic] Error 2
I tried to build kernel following Build your own kernel and Clarkson.edu
I don't see any reference to the symbol "sys_monlak" inside any branch of the official Linux kernel. Are you using a branch obtained from somewhere else?
This error would happen if a driver depends on a symbol "sys_monlak" which should be defined elsewhere in the kernel but isn't, or perhaps the correct kernel module isn't enabled in the kernel config.
You can try running:
$ grep -R "sys_monlak"
If this produces a c file then you can then try to find the Makefile which should compile in this c file. If, for example, the file was called "arch/x86/monlak.c" you might find the following in the file "arch/x86/Makefile":
obj-$(CONFIG_MONLAK) += monlak.o
In this case you would want to try to enable CONFIG_MONLAK in the kernel config.
The other possibility is that you might want to disable the module that depends on the symbol 'sys_monlak'. Try to carefully read the description in the Kconfig file to see what each module does (the one that depends and the one that provides).
Related
I download iasl 20190509 version in Ubunt18.04.5 LTS.
When I use "make iasl" command to build the package, I get this error:
$ make iasl
make[1]: Entering directory 'acpica-unix2-20190509/generate/unix/iasl'
- bison obj/aslcompiler.y
acpica-unix2-20190509/generate/unix/iasl/obj/aslcompiler.y:1.1: error: syntax error, unexpected end of file
mv: cannot stat 'obj/AslCompiler.LLW4kB/y.tab.h': No such file or directory
Makefile:322: recipe for target 'obj/aslcompiler.y.h' failed
make[1]: *** [obj/aslcompiler.y.h] Error 1
make[1]: Leaving directory 'acpica-unix2-20190509/generate/unix/iasl'
generate/unix/Makefile.common:7: recipe for target 'iasl' failed
make: *** [iasl] Error 2
Please help me fix this error.
Please help me build iasl.
The solution was to retry the make but making sure that the build directory is clean first:
$ make clean && make
Here's my best guess as to what happened:
An attempt was made to build the software package.
That attempt failed because the m4 tool had not previously been installed.
OP installed m4, and reran the build with make.
Because of an inadequacy in the provided Makefile, make did not attempt to run m4 again. (See below.) Consequently, processing of the file supposedly generated by m4 failed.
This software package relies on m4 to create the source for bison by interpolating various component files. (Yacc/Bison doesn't have an include feature, so m4 is the usual solution.) However, the command to run m4 is roughly (with paths simplified):
$ m4 aslparser.y > aslcompiler.y
When the shell executes this command, it creates or truncates aslcompiler.y
before even attempting to invoke m4. If it turns out that m4 can't be found, or if m4 produces some sort of error, you end up with an empty or partial output file.
The make target aslcompiler.y is satisfied by this artefact, since make only cares that the target was created later than its dependencies. So the next invocation of make goes on to the next step (bison aslcompiler.y), which fails because aslcompiler.y is empty.
The Makefile would have been better written to use a command like:
$ m4 aslparser.y > /tmp/aslcompiler.y && mv /tmp/aslcompiler.y aslcompiler.y
in order to avoid creating the target if m4 failed. Of course, that's not your responsibility. It could be reported as a bug to the iASL project. (The Makefile already uses this strategy to safely handle the files generated by Bison, so it's not really anything new.)
I'm new to emscripten; several days ago I've downloaded it just to try to make a port of a game to JS.
Anyway, after some steps, I'm having this issue now (on Ubuntu 16.04 STL).
By following build steps here, first of all, I've set environment variables with
source ./emsdk_env.sh and then I've tried to configure the project with emconfigure ./configure in the project directory. When checking for tools emscripten needs, I've got this error:
checking for SDL... no
configure: error: Package requirements (sdl2 >= 2.0.1) were not met:
No package 'sdl2' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables SDL_CFLAGS
and SDL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
ERROR:root:Configure step failed with non-zero return code 1! Command line: ['./configure'] at ...
So I've tried to set that variable with the following command:
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/
This is where actually sdl2.pc is located on my machine, but it didn't help.
So then I've set the following variables that emconfigure needed:
export SDL_PATH=/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/system/include/SDL/SDL.h
export SDL_LIBS=/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/system/include/SDL/SDL.h
export SDL_CFLAGS=/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/system/include/SDL/SDL.h
export SDLNET_LIBS=/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/system/include/SDL/SDL.h
export SDLNET_CFLAGS=/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/system/include/SDL/SDL.h
export SDLMIXER_LIBS=/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/system/include/SDL/SDL.h
export SDLMIXER_CFLAGS=/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/system/include/SDL/SDL.h
and relaunched emconfigure ./configure which has completed well.
So the next step is emmake make that gives me the following error:
make all-recursive
make[1]: Entering directory '/home/ustym/Documents/Projects/chocolate-doom-3.0.0'
Making all in textscreen
make[2]: Entering directory '/home/ustym/Documents/Projects/chocolate-doom-3.0.0/textscreen'
Making all in fonts
make[3]: Entering directory '/home/ustym/Documents/Projects/chocolate-doom-3.0.0/textscreen/fonts'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/ustym/Documents/Projects/chocolate-doom-3.0.0/textscreen/fonts'
Making all in .
make[3]: Entering directory '/home/ustym/Documents/Projects/chocolate-doom-3.0.0/textscreen'
CC txt_conditional.o
Traceback (most recent call last):
File "/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/emcc", line 11, in <module>
python_selector.run(__file__)
File "/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/tools/python_selector.py", line 38, in run
sys.exit(run_by_import(filename, main) if on_allowed_version() else run_by_subprocess(filename))
File "/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/tools/python_selector.py", line 13, in run_by_import
return getattr(importlib.import_module(os.path.basename(filename)), main)()
File "/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/emcc.py", line 1345, in run
assert header.endswith(HEADER_ENDINGS), 'if you have one header input, we assume you want to precompile headers, and cannot have source files or other inputs as well: ' + str(headers) + ' : ' + header
AssertionError: if you have one header input, we assume you want to precompile headers, and cannot have source files or other inputs as well: ['/home/ustym/Documents/Projects/emsdk/emscripten/1.37.38/system/include/SDL/SDL.h', 'txt_conditional.c'] : txt_conditional.c
Makefile:447: recipe for target 'txt_conditional.o' failed
make[3]: *** [txt_conditional.o] Error 1
make[3]: Leaving directory '/home/ustym/Documents/Projects/chocolate-doom-3.0.0/textscreen'
Makefile:467: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/ustym/Documents/Projects/chocolate-doom-3.0.0/textscreen'
Makefile:585: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/ustym/Documents/Projects/chocolate-doom-3.0.0'
Makefile:438: recipe for target 'all' failed
make: *** [all] Error 2
that means, I assume, that SDL_PATH, SDL_LIBS, SDL_CFLAGS... variables weren't set correctly. Or maybe I just need to precompile that headers in the SDL directory.
One last thing: if I skip setting SDL variables and the configuration step and just launch emmake make, the compilation goes well, but then, emcc command gives me
WARNING:root: .o is not valid LLVM bitcode
for all generated .o files. And that actually makes sense.
So I'm pretty stuck here. Somebody can tell me how to set correctly PKG_CONFIG_PATH for emscripten or if i really need to precompile those headers in the SDL directory? Thanks!
First of all, setting PKG_CONFIG_PATH, include or, even worse, library directories (-I and -L) to host libraries' ones looks like awful idea to me: Emscripten object files contain LLVM bitcode (and not host machine code), its .so files AFAIK contain bitcode as well. It is that bitcode that gets translated to JS, not host machine code. So you need to build your program's dependencies with Emscripten by yourself (and should most probably not install them to the host system). Fortunately, there are some official Emscripten ports (see here) for details.
Emscripten has its own implementation of SDL v1 (that you probably tried to use manually), but your program seems to require SDL2. Good news: you probably just need to pass -s USE_SDL=2 to CFLAGS and LDFLAGS when configureing (see later on the link above for information on SDL2 port). Bad news: something may not be fully ported. But I successfully used it to some extent.
When you have configured on host and make with emmake you probably had compiler paths among other parameters adjusted by emconfigure and emmake already baked into generated Makefile by ./configure not controlled by emconfigure, so host gcc/clang just generated machine code.
I have cross-compiled libpng 1.6.28, libjpeg-turbo 1.5.1 and GLib 2.50.3 for MS Windows with i686-w64-mingw32 on Debian Stretch to a special folder, but still can't get gdk-pixbuf working. My commandline used for configure is:
./configure --host=i686-w64-mingw32 PKG_CONFIG_PATH=/usr/local/mingw32-i686/lib/pkgconfig --prefix=/usr/local/mingw32-i686
It passes the configure part fine, but problems start at making point. It throws the following error:
/usr/local/mingw32-i686/lib/libgio-2.0.a(libgio_2_0_la-giomodule.o): In function `DllMain#12':
/home/maju/GTK-build/glib-2.50.3/gio/giomodule.c:942: multiple definition of `DllMain#12'
./.libs/libgdk_pixbuf-2.0.a(libgdk_pixbuf_2_0_la-gdk-pixbuf-io.o):gdk-pixbuf-io.c:(.text+0x1ca): first defined here
collect2: error: ld returned 1 exit status
Makefile:1859: polecenia dla obiektu 'gdk-pixbuf-csource.exe' nie powiodły się
(last line is just untranslated error message for gdk-pixbuf-csource.exe).
It's also followed by warning messages:
*** Warning: This system cannot link to static lib archive libgdk_pixbuf-2.0.la.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** But as you try to build a module library, libtool will still create
*** a static module, that should work as long as the dlopening application
*** is linked with the -dlopen flag to resolve symbols at runtime.
for every required library.
Can anyone explain it to me?
the DllMain might mean “glib for doze doesn’t build static right”
this patch
https://lists.fedoraproject.org/pipermail/mingw/2013-March/006441.html
still applies for later versions of glib. lame.
updated version of patch https://bugzilla.redhat.com/show_bug.cgi?id=1306047
https://bugzilla.redhat.com/attachment.cgi?id=1122789 is seemingly final version of that patch, see
https://smani.fedorapeople.org/glib-prefer-constructors-over-DllMain.patch
Not sure about the cannot link, I configure glib for cross compile like --host=i686-w64-mingw32 --prefix=/Users/rdp/dev/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 --disable-shared --enable-static --with-pcre=internal
FWIW
I am fairly new to programming and have mostly programmed using textfiles but now I am supposed to start using CodeLite for an assignment. I am using windows 10 64-bit.
The problem is that I cannot seem to get my compiler to work in codelite the error message I receive is this:
C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-32/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ hello - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/codelitews/hello'
'makedir' is not recognized as an internal or external command, operable program or batch file.
mingw32-make.exe[1]: *** [Debug/.d] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
hello.mk:88: recipe for target 'Debug/.d' failed
built-in: fatal error: opening dependency file ./Debug/main.c.o.d: No such file or directory
compilation terminated.
mingw32-make.exe[1]: *** [Debug/main.c.o.d] Error 1
hello.mk:99: recipe for target 'Debug/main.c.o.d' failed
mingw32-make.exe[1]: Leaving directory 'C:/codelitews/hello'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====
And I cannot figure out what this means and why it happens since the same compiler works just fine with codeblocks. I have tried googling this issue but have not found something useful. Help would be much appreciated.
Thanks.
CodeLite should be able to recognize makedir.exe it is located under the same folder where you installed codelite.exe
If it does not, then it means that something terribly went wrong, usually this happens when you start modifying the PATH environment variable without knowing what you are doing.
Can you please paste the content of your environment variable (from within CodeLite). From the main menu, go to: Settings->Environment Variables and paste here the content of the text box
Eran
Greeting everyone on stackoverflow!
I am trying to add fpirntf() to XNU kernel tcp_xxx.c file, so when TCP moves it can print parameters to a file, for better understanding how TCP works, but fatal error occurs like follows:
$ sudo make ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=DEBUG
CC tcp_output.o
/Users/wangweikai/Desktop/xnubuilder/xnu-2422.90.20/bsd/netinet/tcp_output.c:135:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
make[7]: *** [tcp_output.o] Error 1
make[6]: *** [build_all] Error 2
make[5]: *** [do_all] Error 2
make[4]: *** [build_all] Error 2
make[3]: *** [build_all_recurse_into_conf] Error 2
make[2]: *** [build_all_recurse_into_bsd] Error 2
make[1]: *** [build_all_bootstrap_DEBUG^X86_64^NONE] Error 2
make: *** [all] Error 2
It looks there is no stdio.h in xnu source code, to solve this I re-installed xcode 5.0.2(only this works with xnu-2422) and outputs mach_kernel able to boot; I tried install command line tools by "xcode-select --install" in terminal, but not working neither.
BTW if I add printf() without #include it gives no error, it looks print function is defined by file with name other than stdio.h.
Since my point is to log how TCP parameters(such as congestion window size and next sequence number and so on)changes in a file, so if there is any way can do this please also tell me, I am total new to xnu and C programming.
Best regards.
Standard I/O (i.e, stdio) is not available in the kernel. To output debugging information from the kernel, call printf(); its output will be visible in the kernel log. Writing data to files directly from the kernel is complicated, and is rarely advisable. (In this case, it may in fact lead to hard lockups, e.g, if the file being written to is on a network volume!)
If you are new to C programming, this is not a good first project. Kernel development is difficult, unforgiving stuff, particularly for the XNU kernel; errors will often cause your computer to crash, potentially losing data, and debugging services are often not available. If you have your heart set on examining an OS kernel, though, the Linux kernel is much easier to work with — it can be easily booted and debugged in a virtual machine, and is far better documented.