LuaFormatter icon indicating copy to clipboard operation
LuaFormatter copied to clipboard

_FORTIFY_SOURCE seems to break compilation

Open tammela opened this issue 5 years ago • 2 comments

Compiling with _FORTIFY_SOURCE, which might standard in some distros, seems to break the compilation process with an error on libc's function vnsprintf().

The following patch can fix the compilation:

-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -Wall")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -U_FORTIFY_SOURCE -Wall")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -U_FORTIFY_SOURCE -O3")

Might need more info as alpine uses musl.

Setup: Alpine 39 gcc (Alpine 8.3.0) 8.3.0

tammela avatar Feb 02 '20 20:02 tammela

i want to look on this issue. Is this error arose after addition of libraries to make work on all platform?

karanankit01 avatar Feb 24 '20 19:02 karanankit01

No.

Just do a build on a alpine virtual machine and it shall reproduce the issue.

Thanks, Pedro

On Mon, 24 Feb 2020, 20:10 Ankit Karan, [email protected] wrote:

i want to look on this issue. Is this error arose after addition of libraries to make work on all platform?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Koihik/LuaFormatter/issues/89?email_source=notifications&email_token=ACECBMY5WPEMVOZVA3TGLLDREQLTRA5CNFSM4KO33422YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMZEXLI#issuecomment-590498733, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACECBM7U6QNR35HZHXI6P2TREQLTRANCNFSM4KO3342Q .

tammela avatar Feb 24 '20 19:02 tammela