glibc/scripts
Joseph Myers 477a02f637 Make gen-as-const.py handle '--' consistently with awk script.
It was reported in
<https://sourceware.org/ml/libc-alpha/2018-12/msg00045.html> that
gen-as-const.py fails to generate test code in the case where a .sym
file has no symbols in it, so resulting in a test failing to link for
Hurd.

The relevant difference from the old awk script is that the old script
treated '--' lines as indicating that the text to do at the start of
the test (or file used to compute constants) should be output at that
point if not already output, as well as treating lines with actual
entries for constants like that.  This patch changes gen-as-const.py
accordingly, making it the sole responsibility of the code parsing
.sym files to determine when such text should be output and ensuring
it's always output at some point even if there are no symbols and no
'--' lines, since not outputting it means the test fails to link.
Handling '--' like that also avoids any problems that would arise if
the first entry for a symbol were inside #ifdef (since the text in
question must not be output inside #ifdef).

Tested for x86_64, and with build-many-glibcs.py for i686-gnu.  Note
that there are still compilation test failures for i686-gnu
(linknamespace tests, possibly arising from recent posix_spawn-related
changes).

	* scripts/gen-as-const.py (compute_c_consts): Take an argument
	'START' to indicate that start text should be output.
	(gen_test): Likewise.
	(main): Generate 'START' for first symbol or '--' line, or at end
	of input if not previously generated.
2018-12-03 22:08:50 +00:00
..
abi-versions.awk
abilist.awk scripts/abilist.awk: Handle special _end symbol for Hurd 2018-11-30 22:22:57 +01:00
backport-support.sh
build-many-glibcs.py posix: Do not include testcases.h, ptestcases.h in source tree 2018-11-29 13:51:25 +01:00
check-c++-types.sh
check-execstack.awk check-execstack: Permit sysdeps to xfail some libs 2018-07-20 03:28:14 +02:00
check-initfini.awk Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
check-installed-headers.sh
check-local-headers.sh
check-localplt.awk
check-textrel.awk
config-uname.sh
config.guess Update config.guess and config.sub to current versions. 2018-11-19 16:51:42 +00:00
config.sub Update config.guess and config.sub to current versions. 2018-11-19 16:51:42 +00:00
cpp
cross-test-ssh.sh
documented.sh
evaluate-test.sh
firstversions.awk
gen-as-const.py Make gen-as-const.py handle '--' consistently with awk script. 2018-12-03 22:08:50 +00:00
gen-libc-abis
gen-libc-modules.awk
gen-posix-conf-vars.awk
gen-py-const.awk
gen-rrtypes.py
gen-sorted.awk
gen-tunables.awk
haveversions.awk Don't build libnsl for new ABIs 2018-09-24 10:23:10 +02:00
install-sh
lib-names.awk
list-fixed-bugs.py
list-sources.sh
localplt.awk
merge-test-results.sh
mkinstalldirs
move-if-change
output-format.sed
pylint
pylintrc
rellns-sh
soversions.awk
sysd-rules.awk
test_printers_common.py
test_printers_exceptions.py
test-installation.pl Fix hardcoded /tmp paths in testing (bug 13888). 2018-06-26 21:48:48 +00:00
update-abilist.sh scripts/update-abilist.sh: Accept empty list of files to patch 2018-06-14 09:37:31 +02:00
update-copyrights
versionlist.awk
versions.awk