about summary refs log tree commit diff
path: root/scripts/gen-as-const.awk
Commit message (Collapse)AuthorAgeFilesLines
* Replace gen-as-const.awk by gen-as-const.py.Joseph Myers2018-11-301-63/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces gen-as-const.awk, and some fragments of the Makefile code that used it, by a Python script. The point is not such much that awk is problematic for this particular script, as that I'd like to build up a general Python infrastructure for extracting information from C headers, for use in writing tests of such headers. Thus, although this patch does not set up such infrastructure, the compute_c_consts function in gen-as-const.py might be moved to a separate Python module in a subsequent patch as a starting point for such infrastructure. The general idea of the code is the same as in the awk version, but no attempt is made to make the output files textually identical. When generating a header, a dict of constant names and values is generated internally then defines are printed in sorted order (rather than the order in the .sym file, which would have been used before). When generating a test that the values computed match those from a normal header inclusion, the test code is made into a compilation test using _Static_assert, where previously the comparisons were done only when the test was executed. One fragment of test generation (converting the previously generated header to use asconst_* prefixes on its macro names) is still in awk code in the makefiles; only the .sym processing and subsequent execution of the compiler to extract constants have moved to the Python script. Tested for x86_64, and with build-many-glibcs.py. * scripts/gen-as-const.py: New file. * scripts/gen-as-const.awk: Remove. * Makerules ($(common-objpfx)%.h $(common-objpfx)%.h.d): Use gen-as-const.py. ($(objpfx)test-as-const-%.c): Likewise.
* Fix 64-bit platform handling in test cases for generated headers with constants.Ulrich Drepper2009-08-161-1/+2
|
* * scripts/gen-as-const.awk: Use 32-bit values on 32-bit platforms.Ulrich Drepper2008-08-061-3/+11
|
* * scripts/gen-as-const.awk: Generate more widely usable code byUlrich Drepper2008-07-261-3/+5
| | | | using 64-bit arithmetic.
* * scripts/gen-as-const.awk: Add cast to long to avoid int promotionUlrich Drepper2007-01-191-1/+1
| | | | of values on 64-bit platforms which are too large.
* * sysdeps/unix/sysv/linux/i386/ucontext_i.h: File removed.Roland McGrath2005-12-221-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sysdeps/unix/sysv/linux/i386/ucontext_i.sym: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h: File removed. * sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h: File removed. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym: New file. * sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.h: File removed. * sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.h: File removed. * sysdeps/unix/sysv/linux/s390/ucontext_i.sym: New file. * sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.h: File removed. * sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym: New file. * sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.h: File removed. * sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym: New file. * sysdeps/unix/sysv/linux/x86_64/ucontext_i.h: File removed. * sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym: New file. * sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = stdlib]: (gen-as-const-headers): Add it. * sysdeps/unix/sysv/linux/powerpc/Makefile: Likewise. * sysdeps/unix/sysv/linux/sh/Makefile: Likewise. * sysdeps/unix/sysv/linux/s390/Makefile: Likewise. * sysdeps/unix/sysv/linux/x86_64/Makefile: Likewise. * stdlib/tst-ucontext-off.c: File removed. * stdlib/Makefile (tests): Remove it. * scripts/gen-as-const.awk: Support generating a test program. * Makerules [gen-as-const-headers] (tests): Add test-as-const. [gen-as-const-headers] ($(objpfx)test-as-const.c): New target.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-24/+4
|
* 2.5-18.1Jakub Jelinek2007-07-121-4/+24
|
* * Makerules (check-abi-%): Use two rules for $(common-objpfx) andRoland McGrath2003-01-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | $(objpfx) directories, and get rid of vpath directives. The previous arrangement resulted in files being written to the source directories when run in a clean build. Find all .abilist files in $(..)abilist/. (update-abi-%): Likewise. (generated): Don't add .symlist files, they'll be intermediates. * sysdeps/generic/init-first.c: Add a comment. * elf/Makefile ($(objpfx)ld.so): Pass -z defs in link. * scripts/gen-as-const.awk: Grok lone "--" as a separator between #includes and expressions. * scripts/merge-abilist.awk: Omit cpu-.*-os.*/modifier from merged config list when it already contains cpu-.*-os.* without / part. * Makerules (sed-remove-dotdot): New variable. ($(common-objpfx)%.make): Use it. Depend on $(before-compile). ($(common-objpfx)%.h $(common-objpfx)%.h.d): Likewise. (check-abi-config): New variable, append /tls or /notls to the tuple. (check-abi-%): Use that for -v config value. Find .abilist files in abilist/libfoo.abilist, not in subdir. * Rules: Move bits/stdio_lim.h generation rules to Makerules.
* 2002-12-27 Roland McGrath <roland@redhat.com>Roland McGrath2002-12-271-0/+29
* scripts/gen-as-const.awk: New file. * Makefile (distribute): Add it. * Makerules ($(common-objpfx)%.h %.h.d: %.sym): New pattern rule. (before-compile): Add $(gen-as-const-headers:%.sym=$(common-objpfx)%.h) to the list. (+depfiles): Add $(addprefix $(common-objpfx),$(gen-as-const-headers)).