ksh-community / ksh

ksh93 maintenance and development
Eclipse Public License 1.0
26 stars 11 forks source link

CCFLAGS override? #1

Open saper opened 4 years ago

saper commented 4 years ago

We suggest in the instructions to override CCFLAGS like this:

./bin/package make \
    SHELL=/bin/bash CCFLAGS="-xc99 -D_XPG6 -m64 -xO4" LDFLAGS="-m64"

However, there are some places like for example lib/ast/libast/Makefile:

https://github.com/ksh-community/ksh/blob/e7f25423818abe159edf52f5799d66bd3621ab0b/src/lib/libast/Makefile#L13

where CCFLAGS gets overwritten anyway. If we override that, and CC.DLL is needed to be to set -fPIC and things like that we may end up in problems with linking.

I don't have a clear reproduction case for this issue right now, but I have noticed builds breaking when trying to set CCFLAGS to quell clang warnings.

jghub commented 4 years ago

@saper thank you for this heads up. duly noted. as you might imagine, there are still things to organise/adjust in ksh-community layout/setup so far. therefore, it might take some time before someone looks into this more closely. I also presume that there will not be a "one size fits" all recommendation for CCFLAGS settings anyway. e.g AFAICS ubuntu uses

    ./bin/package make CCFLAGS="-g -O2\
       -fdebug-prefix-map=${PWD}=.\
       -fstack-protector-strong\
       -Wformat -Werror=format-security\
       -Wdate-time -D_FORTIFY_SOURCE=2" \
        LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro"

for building...

new FAQs and HOWTOs (or, generally, additional documentation) is one of the medium-term goals of ksh-community as well. so comprehensive, platform-dependent build instructions might be integrated there too if need be.

saper commented 4 years ago

Sure, that's fine. I just posted it because this is what struck me reading project's README. I'll try to post some more details here so feel free to treat it as a "note to self" bug if I may...

jghub commented 4 years ago

sure. please do. and if it is FreeBSD specific, flag it as such ;)

saper commented 4 years ago

No, it is not. Can I edit issue labels?

jghub commented 4 years ago

seemingly not ... what do you want? "documentation"?

jghub commented 4 years ago

I am open to suggestions...