LowFat
LowFat copied to clipboard
misc bug fixes + enable LTO support
Tested on Ubuntu 20.04
@GJDuck hi, I git cloned the forked repo from @ddcc and tested this PR on my laptop Linux Mint 20.3 (which is based on Ubuntu 20.04 package base). This PR works on my linux machine, ie. I can compile LowFat and use it successfully.
Like the issue #20 mentioned, I also could not get LowFat to compile on my Mint 20.3, but this PR can compile.
Environment
OS: Linux Mint 20.3 (Una) Version of the Linux kernel: 5.4.0-104-generic
Software Tested
I happen to keep some logs of software built with LowFat before I upgraded my Mint distro, and I get to compare the before-and-after logs. Here are some software I compared and found no difference in the output:
- Sqlite 3.32
- Git 2.35
and a couple of simple toy examples from coursework
Additional Dependencies
I found that I had to install binutil-dev for the <plugin-api.h>, other I get this error:
/LowFat_ddcc_PR19/llvm-4.0.0.src/tools/gold/gold-plugin.cpp:31:10: fatal error: plugin-api.h: No such file or directory
31 | #include <plugin-api.h>
| ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [tools/gold/CMakeFiles/LLVMgold.dir/build.make:76: tools/gold/CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o] Error 1
sudo apt-get install binutils-dev
Preparing to unpack .../binutils-dev_2.34-6ubuntu1.3_amd64.deb ...
Unpacking binutils-dev (2.34-6ubuntu1.3) ...
Setting up binutils-dev (2.34-6ubuntu1.3) ...
Otherwise the build shell script works.
@FeynmanDNA thanks for testing it. I also tried on an old 16.04 system and it seems to build.
Regarding 8925330, there is a reason why the preinit array is used. Although it has been a few years so I forget the exact reason. Likely some cherry picking will be required.
Just an update on this. I attempted to selectively merge specific patches, but the resulting build would fail the tests due to a misaligned stack. For me, the stack is misaligned regardless on whether 92fa1e0 is used or not, so I am not sure what the problem is. I will get back to this one day...