about summary refs log tree commit diff
path: root/streams/fattach.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-12-03 22:08:50 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-12-03 22:08:50 +0000
commit477a02f63751c4b759ddd9454d17f2a7ad120ee3 (patch)
tree173ff9af686792eb3bb9caab2300e8f5e5d56dcc /streams/fattach.c
parent6af956e5c019637051ba8cfb46cfff9bbe574500 (diff)
downloadglibc-477a02f63751c4b759ddd9454d17f2a7ad120ee3.tar.gz
glibc-477a02f63751c4b759ddd9454d17f2a7ad120ee3.tar.xz
glibc-477a02f63751c4b759ddd9454d17f2a7ad120ee3.zip
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.
Diffstat (limited to 'streams/fattach.c')
0 files changed, 0 insertions, 0 deletions