fluent-bit icon indicating copy to clipboard operation
fluent-bit copied to clipboard

Libraries backtrace and luajit does not compile with PIC correctly

Open sirwio opened this issue 4 years ago • 2 comments

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.

sirwio avatar May 07 '21 16:05 sirwio

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

sirwio avatar May 07 '21 16:05 sirwio

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.

github-actions[bot] avatar Jun 07 '21 02:06 github-actions[bot]

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.

github-actions[bot] avatar Nov 26 '24 02:11 github-actions[bot]

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.

github-actions[bot] avatar Aug 27 '25 02:08 github-actions[bot]