[Crash-utility] [PATCH] Flush the build data generated by configure into build_data.c

Lianbo Jiang lijiang at redhat.com
Tue Feb 15 14:11:25 UTC 2022


The build_data.c is dynamically generated by configure, sometimes the
data may not be synchronized to the file build_data.c, as a result,
it will break the compilation process with the following error:

$ for i in {1..50} ; do make clean ; rm -rf gdb-10.2/ ; make warn ;\
[ $? -ne 0 ] && echo "TRY $i" && break ; done

...
ar: creating crashlib.a
  CXXLD  gdb
/usr/bin/ld: ../../crashlib.a(main.o): in function `dump_build_data':
/home/crash/main.c:1829: undefined reference to `build_command'
/usr/bin/ld: /home/crash/main.c:1830: undefined reference to `build_data'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:1872: gdb] Error 1
make[3]: *** [Makefile:10072: all-gdb] Error 2
make[2]: *** [Makefile:860: all] Error 2
crash build failed

The fflush() will help flush the data into the build_data.c.

Signed-off-by: Lianbo Jiang <lijiang at redhat.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab at nec.com>
---
 configure.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.c b/configure.c
index 51888519c18c..41d096bc56ca 100644
--- a/configure.c
+++ b/configure.c
@@ -1337,6 +1337,7 @@ make_build_data(char *target)
         pclose(fp1);
         pclose(fp2);
         pclose(fp3);
+	fflush(fp4);
 	fclose(fp4);
 }
 
-- 
2.20.1




More information about the Crash-utility mailing list