Hi Andy!

I'm working on trimming musl down and extracting it's libm to it's core. This 
will solve all warnings during the module build stage, and won't need to modify 
LinuxCNC's code at all from it's current state. This is an on-and-off project 
and it's going to take awhile to work out all the kinks.

The musl tree can be trimmed down much further, it's a work in progress, but 
this is what I have right now:

https://github.com/NTULINUX/RTAI/commit/1c5a79850368698265adee10bb4083c1ced4b82f

LinuxCNC works with that branch as-is, but in order for this project to be 
sustainable and clean, libm needs to be further isolated and there's a lot of 
headers that need to be broken up and removed.

I can do this, but it just takes time to weed through everything. All of the 
syscall+atomic code for example can and should be removed, but this requires 
more changes to the musl tree, and I'm not quite there yet.

The final goal is to merge the absolute minimum of musl's math code into the 
master branch, and only export the symbols needed for LinuxCNC. LinuxCNC does 
not need 200+ math symbols, only like 10.

I have heard so much conflicting information with GCC built-ins.

One guy says: "GCC built-in functions, like atan, do not actually define what 
atan is. These are simply calls to tell GCC to optimize these functions as the 
compiler sees fit"

Another says: "GCC built-in functions can replace the math functions that 
rtai_math.ko is providing, removing the need of musl or rtai_math.ko at all."

Both can't be right, I don't know who is right, but apparently blindly 
switching all of LinuxCNC's math functions to #define <math 
func>__builtin_<math func> doesn't work. I have read that appending `-lm` to 
CFLAGS is how you solve that, but I didn't have success with that either.

Me not being an expert in GCC and preprocessors, extracting the bare bones math 
functionality of musl is the best thing I can come up with, personally. I 
admittedly don't know enough about compilers to comment more on this subject. 
On top of that, all of this building is happening inside Kbuild, making 
debugging the compiling process more difficult.

Is there even a way to build an out-of-tree kernel module using `-S` passed to 
GCC, so I can see the generated assembly?

https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#Overall-Options

"Stop after the stage of compilation proper; do not assemble. The output is in 
the form of an assembler code file for each non-assembler input file specified. 
By default, the assembler file name for a source file is made by replacing the 
suffix ‘.c’, ‘.i’, etc., with ‘.s’. Input files that don’t require compilation 
are ignored."

The reason I ask is because I'm currently stuck with `objdump` which I'm 
admittedly rubbish at, and still learning.

Alec


_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to