Hi everyone,
We have an in-house filesystem that performs reads, writes, stats and the whole shebang pertaining to what a FS should do. However, the driver is smart, it can figure out what FS it is talking to and depending on that routes the request to the driver code. There is a standard library (stdio.h) wrapper file that creates a shared library (libstd.so) which is used for all the std, io and stuff.
My problem starts here. I have to make a 3rd party tool that does a lot of file reads, writes (written in go) use that shared library. After a week of trying to figure this out I feel like I am grasping at straws here. So I would love some guidance or directions on setting my path straight. Here is what I think is the solution and I might be wrong.
My theory is that if I can compile the standard go packages namely std, io, os and syscalls to somehow use the wrapper based libstd.so file, I can then re-compile the 3rd party tool using dynamic linking and it will work. I started looking at it and saw that it’s the gccgo that’s compiling the standard libraries. So I got into a rabbit hole where I am trying to compile gccgo locally so that I can use that to compile go standard libraries and I am stuck. And thus the questions:
- Is my theory correct? And will I have to manually compile the gccgo compiler to use the wrapper libc standard functions?
- Is there a better approach to all this?
Thanks for reading through the question. I appreciate your time.
Thanks