Libraries backtrace and luajit does not compile with PIC correctly
This was disproved when compiling fluent-bit with PIE by setting CMAKE_EXE_LINKER_FLAGS=-pie
The backtrace project seems to require to explicitly set --with-fpic to be compiled with PIC support. The luajit has a wierd construct of setting fpic in the XCFLAGS. XCFLAGS is inteded to be used when compiling the compiler itself - not for this purspose. Instead this commit sets CFLAGS=-fpic for UNIX builds. The XCFLAGS is kept since other platforrms/compilers may depend on it.
Signed-off-by: sirwio [email protected]
Enter [N/A] in the box, if an item is not applicable to your change.
Testing Before we can approve your change; please submit the following in a comment:
- [ N/A] Example configuration file for the change
- [ N/A] Debug log output from testing the change
- [ N/A] Attached Valgrind output that shows no leaks or memory corruption was found
Documentation
- [ N/A] Documentation required for this feature
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
The problem may not be found with newer gcc compilers since they may compile with -fPIC by default.
The issue was found when compiling with gcc version 4.4.7
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.