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 Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
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 Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
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 hurd: Fix inclusion of mach headers in all standards 2018-03-04 02:53:09 +01:00
check-local-headers.sh Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
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 Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
documented.sh
evaluate-test.sh Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
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 Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gen-rrtypes.py Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gen-sorted.awk Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gen-tunables.awk Fix range check in do_tunable_update_val 2017-09-27 02:44:09 +05:30
haveversions.awk Don't build libnsl for new ABIs 2018-09-24 10:23:10 +02:00
install-sh Update miscellaneous files from upstream sources. 2017-12-20 22:28:20 +00:00
lib-names.awk
list-fixed-bugs.py Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
list-sources.sh
localplt.awk
merge-test-results.sh Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mkinstalldirs Update miscellaneous files from upstream sources. 2016-12-21 16:05:55 +00:00
move-if-change Update miscellaneous files from upstream sources. 2018-01-01 18:05:06 +00:00
output-format.sed
pylint
pylintrc
rellns-sh Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
soversions.awk
sysd-rules.awk
test_printers_common.py Disable lock elision for mutex pretty printer tests. 2018-04-19 12:45:11 +02:00
test_printers_exceptions.py Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
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 Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
versionlist.awk Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
versions.awk Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00