76b6d9
commit 7b36d26b22d147ffc347f427f9fd584700578a94
76b6d9
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
76b6d9
Date:   Mon Dec 3 14:40:48 2018 +0100
76b6d9
76b6d9
    Fix test-as-const-jmp_buf-ssp.c generation on gnu-i386
76b6d9
    
76b6d9
    hurd's jmp_buf-ssp.sym does not define any symbol.
76b6d9
    scripts/gen-as-const.py currently was emitting an empty line in that
76b6d9
    case, and the gawk invocation was prepending "asconst_" to it, ending up
76b6d9
    with:
76b6d9
    
76b6d9
    .../build/glibc/setjmp/test-as-const-jmp_buf-ssp.c:1:2: error: expected « = », « , », « ; », « asm » or
76b6d9
    « __attribute__ » at end of input
76b6d9
        1 |  asconst_
76b6d9
          |  ^~~~~~~~
76b6d9
    
76b6d9
            * scripts/gen-as-const.py (main): Avoid emitting empty line when
76b6d9
            there is no element in `consts'.
76b6d9
76b6d9
diff --git a/scripts/gen-as-const.py b/scripts/gen-as-const.py
76b6d9
index b7a5744bb192dd67..cabf401ed15e8367 100644
76b6d9
--- a/scripts/gen-as-const.py
76b6d9
+++ b/scripts/gen-as-const.py
76b6d9
@@ -153,7 +153,7 @@ def main():
76b6d9
         print(gen_test(sym_data))
76b6d9
     else:
76b6d9
         consts = compute_c_consts(sym_data, args.cc)
76b6d9
-        print('\n'.join('#define %s %s' % c for c in sorted(consts.items())))
76b6d9
+        print(''.join('#define %s %s\n' % c for c in sorted(consts.items())), end='')
76b6d9
 
76b6d9
 if __name__ == '__main__':
76b6d9
     main()