I am new to compiling kernels, and am struggling to apply the CK kernel patch.
As an example, I am trying to apply his 4.18 patch to a 4.18 kernel -- the files linked at the top of this page.
I'm using Arch linux, and can successfully compile the kernel (without the patch) following the instructions given here. I can do this with the config file that ships with Arch (accepting the defaults to any queries when running make nconfig) or with make localmodconfig to get a slimmed down kernel.
Applying the patch (patch -p1 < name_of_patch_file), rebuilding the config with localmodconfig, and recompiling, consistently fails at the compilation stage. With 4.19 kernels, I get undefined reference to "sched_smt_present". With 4.18 the errors get lost in the scrolling output, but the compile does not complete successfully.
I hope I have explained myself properly here -- apologies if not. I am fully convinced that I am doing something wrong, and would very much appreciate any pointers you can give.
Related
I have been trying to go through this tutorial and I always get stuck in the second build of GCC when making the cross-toolchain. It errors out saying that I am attempting to call a poisoned calloc. I have gone through several patches and what they all seem to do is just #include the offending system header (in this case pthread.h) earlier in the source code. Since there are no patches for my particular problem, I have gone ahead and emulated their solutions in my case. While this works (compilation now fails because I don't have some ISL files) it feels like a hack, and I suspect that the root problem is further back in the build.
Thus, I wanted to ask:
Why are symbols poisoned? Why would the GCC maintainers want some symbols not to be used?
What are the general causes for this problem? Is it really just a bug or is this a problem that arises in more general situations?
I am more interested in the generalities of this issue, but if it helps, I am using the latest release of Alpine Linux (with gcc 12.2.1) trying to compile gcc 11.2
.0 for the same target architecture as the host (x86-64).
I'm afraid my question is a bit complex. Appreciate anyone who can help.
Some background:
I have a 3rd party SW package that compile both kernel modules and user space applications.
Unfortunately, this 3rd party is very complex, and doesn't use Kbuild for building kernel modules (I tried without success)
When compiling the kernel modules, I add -I{path to kernel headers}, but I see the .config file is not being parsed in the compilation, which, of course, causes many errors.
I tried to manually add all flags from .config to gcc in command line (using a script to generate the command line) but that was a very very long line and gcc couldn't handle it.
So my question would be: Is there a way to force all these flags to gcc somehow?
Appreciate your ideas :)
Clarification:
The 3rd party SW can compile on older kernels (2.6, 2.4) I'm trying to compile it for 3.2
Maybe if someone can explain how the original kernel Makefile manages the .config file, I can mimic that behavior.
After digging in the kernel sources, I found the answer. Here it is in case someone needs it.
There's an automatically generated h file called autoconf.h which contains all the relevant definitions in C pre processor format. Just need to include it manually when compiling the module.
Also in theory, I could use my script to create such a file and include it from the sources.
Hope this helps someone. Now on to the next problem :)
I'm trying to build a project (namely, Angband's source - http://rephial.org/downloads/3.3/angband-v3.3.2.tar.gz) with Emscripten's emcc in order to port it to Javascript and ultimately build an online version.
I've managed to get the process started with
emconfigure ./configure
make
which begins to successfully start generating LLVM bitcode .o files, but then it hangs up on main-gcu.c with 'main-gcu.c:43:11: fatal error: 'ncurses.h' file not found'
I believe main-gcu.c is the only file that references ncurses, but I just can't figure out how to include the library while compiling. Is there a way to specify including ncurses with 'make', or should I compile the main-gcu.c file individually, with 'emcc main-gcu.c -c -lncurses'? I tried doing that but that led to another error with emcc being unable to find other actually included header files two levels down (it couldn't find headers that were included by a header included by main-gcu.c - anyway to fix that?).
I'm also not certain if I have/need to install the ncurses library on Mac OSX. All I can really find are references to libncurses5-dev for Linux.
Thanks!
I think you misunderstand the compilation via Emscripten. I will try to point out a few problems you are facing.
The general rule is that all tools of Emscripten ONLY can turn LLVM formats (e.g. BITCODE) into JavaScript. emconfigure, emmake, ... modify the build environment so that your sourcecode is compiled to one of the LLVM formats (there are exceptions to the rule but nevermind). So anything you want to link against your final result has to be in a LLVM format, as well (which by default ncurses is not).
Since the output is JavaScript, there is no chance to execute any program code in different threads. While a lot of C/C++ code does use a thread for the UI and others for processing, such a model does NOT work for Emscripten. So in order to get the software compiling/running you will have to rewrite the parts that use threading. See emscripten_set_main_loop for pointers.
Even if you have the libraries compiled you then have to statically link them to Emscripten. At this point it is less of a technical problem but more of a license issue since if your library is licensed under e.g. LGPL due to static linking the GPL terms are effective.
I hope all clarity finally vanished ;)
I'm trying to port some very old fortran code to windows. I'd like to use mingw and f2c, which has no problem converting the code to usable C on OS X and Ubuntu. I used f2c.exe as distributed by netlib on a fresh install of mingw, and it translated the code fine. I have a "ported" version of libf2c that seems to still contain some unresolved references -- mostly file i/o routines (do_fio, f_open, s_wsfe, e_wsfe) and, peculiarly, one arithmetic routine (pow_dd). To resolve these issues, I tried to build libf2c from source, but ran into an issue during the make process. The make proceeds to dtime_.c, but then fails due to a dependency on sys/times.h, which is no longer a part of the mingw distro. There appears to be a struct defined in times.h that defines the size of a variable in dtime_.c, specifically t and t0 on lines 53 and 54 (error is "storage size of 't' isn't known"; same for t0).
The makefile was modified to use gcc, and make invoked with no other options passed.
Might anyone know of a workaround for this issue? I feel confident that once I have a properly compiled libf2c, I'll be able to link it with gcc and the code will work like it does on linux and os X.
FOLLOW-UP: I was able to build libf2c.a by commenting out the time related files in the makefile (my code does not contain any time related functions, so don't think it will matter). I copied it to a non-POSIX search directory as show in -print-search-dirs, specifically C:\MinGW\lib\gcc\mingw32\3.4.5. That seems to have fixed the issue on the unresolved references, although the need to eliminate the time files does concern me. While my code is now working, the original question stands -- how to handle makefiles that call for sys/times.h in mingw?
Are you sure the MinGW installation went correct? As far as I can tell the sys/times.h header is still there, in the package mingwrt-3.18-mingw32-dev.tar.gz. I'm not familiar with the gui installer, but perhaps you have to tick a box for the mingwrt dev component.
My specs:
OS: Ubuntu 10.04 LTS amd64
fpc: 2.4.0
lazarus: 0.9.28
I'm trying to compile a WebLaz project just by creating one and then compiling.
Somehow the compiler gets all lost when determinig witch httpd and fpapache Units to use.
I've found similar problems in the forums:
mod_helloworld.lpr Can't find fpapache Unit ...
I NEED HELP with fpweb ...
After trying some of the solutions provided there I'm still at this point:
Project compiles fine if I only have httpd22 under the Compiled units and the Source for the packages. Alas it then completely fails to link.
With the original fpc/lazarus folder structure (Having all of HTTPD13, HTTPD20 and HTTPD22 untouched on both locations, units and source) the compiler complains that checksum of httpd has changed and the fails to find fpapache's source.
It finds httpd.pas under httpd20 but then it only works with folders for 2.2
I'm completely lost as how to compile this using the WebLaz component, what am I missing?
Probably you need to select the version you want, and then rebuild the relevant lazarus parts, so that the pkgs get build with the then selected apache.
Afaik the selection of the httpd daemons is simply changing order, it doesn't mean that all versions are supported at once, like e.g. mysqlconnection does.
From what I could investigate from the, very verbose, output using the Test button on the "Compiler Options" none for these option are defined:
FPCAPACHE_1_3
FPCAPACHE_2_0
So this means that in: /etc/fpc.cfg
#IFDEF FPCAPACHE_1_3
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd13/
#ELSE
#IFDEF FPCAPACHE_2_0
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd20/
#ELSE
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd22/
#ENDIF
#ENDIF
The test will revert to httpd22 by default.
None the less, having:
/usr/lib/fpc/2.4.0/units/x86_64-linux/httpd20
/usr/lib/fpc/2.4.0/units/x86_64-linux/httpd22
in the compiler's path to compiled units it means that it will find httpd20 first.
This means it will try to load the 2.0 version and not the 2.2 version of the compiled units.
So the first solution is to delete/move the 1. folder from the system.
This will let you compile, but alas it will not link on a 64 bit system (I'm testing on a AMD64 system so I'm not going to presume it works elsewhere).
The process ends with a hint, to add -fPIC to the compiler options.
If you go to Project->Compiler Options...->Other on the lower TextBox you can add it.
Voila, it's working.