summaryrefslogtreecommitdiff
path: root/cflags.SH
Commit message (Collapse)AuthorAgeFilesLines
* Add the -Wthread-safety also only for clang 3.6 (6.1) or later.Jarkko Hietaniemi2015-12-031-4/+4
| | | | (follow-up to bdc795f4, suggested by Aaron Crane)
* add -Wthread-safety for clang 3.5 or laterJarkko Hietaniemi2015-11-231-0/+23
| | | | | | | With this change there is no need to explicitly e.g. Configure ... -Accflags='-Wthread-safety' since doing just -Dusethreads with recent enough clang will automatically add the -Wthread-safety
* For perl #126468: protect quotes in myccflags.Jarkko Hietaniemi2015-10-291-1/+5
| | | | | Fixes a problem introduced by 57d2761b where ccflags contents with quotes got broken by the quotes getting stripped.
* Prefer -std=c89 over -ansi.Jarkko Hietaniemi2014-11-241-2/+15
|
* Revert "Drop -std=c89."Jarkko Hietaniemi2014-11-241-8/+2
| | | | This reverts commit 0d55a45a6f024919f13cbe70fc861f5eb6d757ee.
* Drop -std=c89.Jarkko Hietaniemi2014-11-201-2/+8
| | | | | | | | (1) It doesn't mean "strict C89" on its own, -pedantic would also be needed. (2) Using C99 features like long long or inline becomes harder. The downside of this change is that C99-isms can more easily creep into the core code, breaking it for non-gcc C89 compilers.
* Downgrade the optimization of regcomp.c on mips and mipsel due to a gcc-4.9 bugNiko Tyni2014-09-201-0/+5
| | | | | | | | | | | | | | | % cat ~/t.pl print ( (q{foo'} =~ /[^']+'/) ? "ok\n" : "not ok\n" ); % perl ~/t.pl ok % ./miniperl ~/t.pl not ok This only happens with -fPIC -ftree-vrp builds. It is a regression from gcc-4.8. Bug-Debian: http://bugs.debian.org/754054 Patch-Name: debian/regcomp-mips-optim.diff
* quadmath Q format specifier and gcc -Wformat do not mix.Jarkko Hietaniemi2014-09-191-0/+15
|
* For older clang versions put back -Wno-unused-value.Jarkko Hietaniemi2014-08-121-0/+11
| | | | | | Logical revert of b679cac0, but redone. Apple versions only for now; situation on Linux side unknown.
* Allow enabling -pedantic(-errors) (with -std=c89) for the core.Jarkko Hietaniemi2014-06-221-34/+91
| | | | | | | | | | | | | | | | | | The core was already -pedantic clean (with default config, with DEBUGGING almost), cflags just needed some juggling, somewhat complicated by the logic of -Werror=declaration-after-statement. Still requires -Dgccansipedantic to enable the -pedantic because otherwise we do not use things like gcc brace groups and C99 variadic macros, which are nice. Also, see below about usedtrace complications. (the gccansipedantic logic was odd, probably not used for a while.) Under -DDEBUGGING the -pedantic requires quieting the warnings about overlong string literals. Disable -pedantic et al if usedtrace is enabled, it uses too many non-standard features (and it depends on code generated by an external framework).
* In case someone manages to call g++ with -Wc++-compat.Jarkko Hietaniemi2014-06-191-0/+1
|
* The g++ flags removal was not right.Jarkko Hietaniemi2014-06-191-3/+5
|
* Add note about the -std=c89 needing -pedantic.Jarkko Hietaniemi2014-06-181-2/+7
|
* Echo also these added options.Jarkko Hietaniemi2014-06-181-3/+12
|
* -Wextra is the new -W, do not use both.Jarkko Hietaniemi2014-06-181-2/+12
|
* -Wendif-labels is actually the default.Jarkko Hietaniemi2014-06-181-1/+1
| | | | | Has been AFAICT for years / always, the documentation just had it wrong in pre-4.0 gccs.
* Enable -Werror=declaration-after-statement.Jarkko Hietaniemi2014-06-181-3/+12
| | | | | For C89 compliancy, this is the most common thinko people make. While waiting for -pedantic -std=c89, which will catch the same.
* Comment tweaking.Jarkko Hietaniemi2014-06-181-2/+13
|
* Make also cflags.SH clean with g++ -Wunused-*Jarkko Hietaniemi2014-06-181-33/+0
| | | | "clean" as in "not needed anymore".
* Looks like the core is now -Wunused-value clean with clang.Jarkko Hietaniemi2014-06-181-20/+0
| | | | | | Another possibility is that clang has become smarter, and that needs to be made dependent on clang version. But for now, let's opt for simplicity and less logic.
* cflags.SH: Whitespace only.Jarkko Hietaniemi2014-06-181-6/+6
|
* Move ccflags edits to extraction time.Jarkko Hietaniemi2014-06-181-56/+92
| | | | | | | | (Except for the possible toke_cflags customizations.) Do the -Wno-unused-... edits only if -Wall. Echo the edits done during extraction time, to make the magic more visible.
* Allow cflags.SH edits to ccflags to stick.Jarkko Hietaniemi2014-06-181-5/+3
|
* Some low-hanging -Wunreachable-code fruits.Jarkko Hietaniemi2014-06-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | - after return/croak/die/exit, return/break are pointless (break is not a terminator/separator, it's a goto) - after goto, another goto (!) is pointless - in some cases (usually function ends) introduce explicit NOT_REACHED to make the noreturn nature clearer (do not do this everywhere, though, since that would mean adding NOT_REACHED after every croak) - for the added NOT_REACHED also add /* NOTREACHED */ since NOT_REACHED is for gcc (and VC), while the comment is for linters - declaring variables in switch blocks is just too fragile: it kind of works for narrowing the scope (which is nice), but breaks the moment there are initializations for the variables (the initializations will be skipped since the flow will bypass the start of the block); in some easy cases simply hoist the declarations out of the block and move them earlier Note 1: Since after this patch the core is not yet -Wunreachable-code clean, not enabling that via cflags.SH, one needs to -Accflags=... it. Note 2: At least with the older gcc 4.4.7 there are far too many "unreachable code" warnings, which seem to go away with gcc 4.8, maybe better flow control analysis. Therefore, the warning should eventually be enabled only for modernish gccs (what about clang and Intel cc?)
* The clang frontend says "unknown" for -Wunknown.Jarkko Hietaniemi2014-06-151-0/+1
| | | | "unknown warning option" (for -W...) or "unknown argument" (for -...).
* do cflags on stdout, not stderrDavid Mitchell2013-12-251-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current UNIX build system does a strange thing to generate the appropriate command-line to compile a particular src file. It calls the cflags shell script, which 1) echoes to stdout the command line needed to compile the specified file (excluding the name of the src file itself), e.g. cc -c -Dfoo -Wbar ... 2) echoes the same thing to stderr, prefixied with ' CCCMD =' Make then does `sh cflags foo.o` foo.c the cflags output to stdout is captured by the backticks, and is used by make as the command line to run (with the foo.c appended). This run is silent. The output to stderr isn't captured, and gets displayed. So the user sees: $ make `sh cflags foo.o` foo.c CCCMD = cc -c -Dfoo -Wbar ... ... This is annoying for 2 reasons: 1) you don't get a simple command-line displayed which you could do a simple cut and paste with (e.g. when you want to recompile a specific source file, but alter the flags). 2) The make generates output on stderr, even when then there aren't any errors. So "make 2>errs" can't be used to quickly spot warnings and errors. This commit fixes this by making cflags just output the cc command and flags to stdout, then get Makefile to call it twice, once to echo the command-line (on stdout), and once to execute it with backticks. So the make output is now: $ make cc -c -Dfoo -Wbar ... foo.c ... There is some stuff in Makefile.SH related to cross-compiling, which this commit make have broken. Specifically the CCCMD and CCCMDSRC macros have been changed in the normal case to remove backticks (and add them to the make rules instead), but not for the cross compilation route. The CC* defs in the cross-compilation case have a trailing -I$(CROSS_LIB) outside of the backticks, which compilates matters. However, in the subdir Cross/, there appears to be separate (and divergent) copies of Makefile.SH and cflags, so maybe the files I edited are no longer used for cross-compilation???? (followup: according to <20131204170112.GA2490@iabyn.com> the cross-compiling stuff I mentioned above has bit-rotted, and I don't need to worry about it)
* cflags/cflags.SH: use '#' commentsDavid Mitchell2013-12-251-19/+19
| | | | | | | | | These scripts had a mixture of old-style ':' comments and new-style '#' comments. Since they have both, the old ones can't be needed for portability reasons, so standardise on the modern form. The old-style were just too confusing, especially as my syntax highlighter didn't know about them.
* cflags.SH - add commentaryDavid Mitchell2013-12-251-0/+17
| | | | | | Add comments to the top of cflags.SH to explain what it does. Also make it output comments at the top of the generated cflags script explaining that its auto-generated.
* cflags.SH: Fix a typo, cflags should be ccflagsBrian Fraser2013-12-111-1/+1
| | | | | This went undetected for the longest time since most flags are irrelevant at this point, but is vital if you are using --sysroot.
* Exempt clang from -Wunused-value when run as ccFather Chrysostomos2013-07-281-0/+9
| | | | | | | We already have an exception for it when called as clang or clang-1.2.3, but not when called as cc or anything else. Mac OS X Mountain Lion therefore ends up spitting out lots of warnings, as cc is a symlink to clang.
* Use -Wno-unused-value also on other clang compilersReini Urban2013-06-271-1/+1
| | | | clang++ or clang-3.2, ...
* If PERL_NO_INLINE_FUNCTIONS is defined, don't include "inline.h"Nicholas Clark2013-05-031-1/+1
| | | | | | | | | | | | | | This permits test code to include the perl headers for definitions without creating a link dependency on the perl library (which may not exist yet). Some of the static inline functions in inline.h reference functions in the perl object files, and some compilers aren't smart enough to eliminate unused static inline functions, hence including the inline.h in probe code can cause link errors even though the probe code uses none of the functions it declares. When probing, a failed link is taken as meaning that the probed-for function is not present, as the assumption is that the link fails because of it. Hence other causes of link failures cause the probing code to generate incorrect results, and action (and bugs) at a distance.
* add shebangs where missingSawyer X2012-09-221-0/+2
|
* In cflags.SH trim the case statement of file basenames.Nicholas Clark2012-06-191-47/+14
| | | | | | | | | | | | | | Add examples showing how to use cflags.SH to tweak the compiler flags used for individual object files. Previously cflags.SH contained a somewhat stale pre-canned list of file basenames including removed files such as usersub (deleted before 5.000 shipped), and a partial list of 5.000 XS extensions. Whilst it's possible to generate the correct list in cflags by parsing MANIFEST (and adding a few fixups), it's still not actually *useful*, as cflags gets overwritten as soon as config.sh changes. Hence the most end-user useful solution with minimal maintenance is to eliminate the list entirely, and document how the user should add to it as necessary.
* cflags: clang complains a lot about -Wunused-value which are not fixableReini Urban2012-06-081-0/+4
|
* Make everything exec-bit.txt lists executableFlorian Ragwitz2010-08-191-0/+0
| | | | | | | All these files used to be executable in the release tarballs. Apparently things also work without that in the repository, but I'd rather add this possibly unecessary change to blead instead of breaking the upcoming release. This should probably be looked into again afterwards.
* RT #74436: [PATCH] Add -Wwrite-stringsRobin Barker2010-08-141-1/+2
| | | | | | The perl source has for some while been clean to -Wwrite-strings. I suggest this warning be added to cflags. The patch makes the appropriate change to cflags.SH and silences a warning from mg.c
* Global executable bit cleanupDavid Golden2010-07-241-0/+0
| | | | | | | | | | | | | | | | | | | | When porting/makerel runs, all files copied into the directory for the tarball have the executable bit stripped and then only a specific set of files have the executable bit restored. There are many files in the repo that have the executable bit set in the repo that will be stripped. So that the state of files in the repo is as close as possible to the state of files in the release tarball, the executable bit has been stripped from such files. In one recent case, a file added from a dual-life module needed the executable bit set. Because it had the bit in the repo but was not listed in makerel to get an executable bit, tests using it passed in the repo and failed in the tarball. This commit refactors the list into a new file, Porting/exec-bit.txt and add tests to detect a mismatch between files listed there and actual executable bits in the repo.
* Convert xsutils.c and lib/attributes.pm to a regular XS extension.Nicholas Clark2009-04-121-1/+0
|
* eliminate .patchnum and related infrastrcuture from *nix based build processYves Orton2009-01-041-8/+3
| | | | Rename the old "unpushed.h" to "git_version.h" and make it hold the defines that used to come from cflags magic
* cflags also runs under /bin/sh so can't use $()Nicholas Clark2008-12-301-4/+4
|
* much better git related version numbering in our (*nix for now) build processYves Orton2008-12-311-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The net result of this patch is to make available via Config.pm and -v/-V the details about the git version info we have available for the build. When built within a git repository git is queried directly. When built from a snapshot or bundle it is assumed that the source is unchanged, and that the required details are avaialble in a file called .patch, whose format current is a four field string in the following format: "$branchname $date.$time $sha1 $describe". The generator of these files currently resides on camel.booking.com. * git-describe is now used more directly with -v. When the prefix of git-describe matches the version number as determined by the defines in patchlevel.h then we use ONLY the git-describe output, otherwise we include the git describe in parenthesis after the version number. Either way the describe text is optionally followed by a star should there be uncommitted changes. eg: This is perl, v5.11.0 (GitLive-blead-136-g58ca560) built for i686-linux or: This is perl, v5.11.0-1-g58ca560 built for i686-linux or: This is perl, v5.11.0 built for i686-linux * include the SHA1 in perl -V summary, and automatically include unpushed commits in the registered patches list * include various git/version/.patch details in %Config, as follows: git_commit_id # sha1 of HEAD git_ancestor # ancestor in $remote/$branch (presumably canonical) git_describe # git describe git_branch # current branch git_uncommitted_changes # "true" if there are any, empty otherwise git_unpushed_commits # List of sha1's of unpushed commits git_commit_id_title # Used to make the perl -V summary output Additionally one more value is added depending on build process used: when building from an rsynced snapshot (or any dist including a file called .patch) then the second field will be used to populate the "git_snapshot_date" field. Otherwise if built in a git directory (as is hopefully recommended these day) then the field will be "git_commit_date" which will be the commit date of HEAD. This patch introduces two new files (on top of .patchnum) that will be generated by make_patchnum.sh: "lib/Config_git.pl" and "unpushed.h", the former is used to make git data available to Config.pm/%Config without rebuilding everything else, and the second is used to expose unpushed commits (if any) via the registered patch facility of patchlevel.h
* forgot that i was modifying a generated fileYves Orton2008-12-271-0/+3
|
* fix broken indentation, and move PERL_PATCHNUM logic to a different place so ↵Yves Orton2008-12-271-35/+37
| | | | it only affects perl.c
* more build dependency changes, we should make sure that cflags is updated ↵Yves Orton2008-12-271-1/+1
| | | | whenever cflags.SH changes
* make sure that the perl -v/-V output corresponds to the latest commitYves Orton2008-12-271-6/+2
|
* /bin/sh isn't /usr/bin/perl :-)Nicholas Clark2008-12-201-2/+4
| | | | | | Change elsif to the correct "else if" construction. I suspect that this slipped by into f6a80292c3db127d1561c118f409c1cffd1b55d9 because cflags.SH doesn't seem to be re-expanded if it's newer than cflags.
* make perl use git-describe for PATCHNUMYves Orton2008-12-201-2/+4
| | | | | | | | | | | This is just an initial attempt at getting something more useful into the -v / -V output. Currently "patchlevel" is really "version", and PATCHNUM is just a special string added to the patchlevel in perl.c via defines created by cflags.SH and its product file cflags, which happens very early in the build process. This means that for committers the -v output is likely to not be upto date unless they run make clean. Anyway, IMO we should rethink a reasonable amount about how we do this, this is just a crude step forward.
* Make struct regexp the body of SVt_REGEXP SVs, REGEXPs become SVs,Nicholas Clark2008-01-021-1/+1
| | | | | | and regexp reference counting is via the regular SV reference counting. This was not as easy at it looks. p4raw-id: //depot/perl@32804
* A new try at getting -fstack-protector working, by adding it to theNicholas Clark2007-12-201-1/+1
| | | | | | gcc link flags so that any implementation dependant libraries are also linked in. p4raw-id: //depot/perl@32669