Skip to content

Commit 67f8b42

Browse files
committed
Fix the sim build
Simon pointed out that the "common/" include change in gdb broke the sim build. The problem was that the sim was using gdb's create-version.sh, which changed. This patch copies create-version.sh to the sim, so that it can generate "version.c" in a way that works in the sim build. Tested by rebuilding. sim/common/ChangeLog 2019-01-26 Tom Tromey <tom@tromey.com> * Make-common.in (version.c): Use sim's create-version.sh. * create-version.sh: New file. sim/ppc/ChangeLog 2019-01-26 Tom Tromey <tom@tromey.com> * Makefile.in (version.c): Use sim's create-version.sh.
1 parent e5e2bc5 commit 67f8b42

5 files changed

Lines changed: 51 additions & 4 deletions

File tree

‎sim/common/ChangeLog‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2019-01-26 Tom Tromey <tom@tromey.com>
2+
3+
* Make-common.in (version.c): Use sim's create-version.sh.
4+
* create-version.sh: New file.
5+
16
2019-01-16 Pavel I. Kryukov <kryukov@frtk.ru>
27

38
* sim-arange.c (DEFINE_INLINE_P, DEFINE_NON_INLINE_P): Remove.

‎sim/common/Make-common.in‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ stamp-tvals: gentmap
289289
$(SHELL) $(srcroot)/move-if-change tmp-tmap.c targ-map.c
290290
touch stamp-tvals
291291

292-
version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/gdb/common/create-version.sh
293-
$(SHELL) $(srcroot)/gdb/common/create-version.sh $(srcroot)/gdb \
292+
version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/sim/common/create-version.sh
293+
$(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb \
294294
$(host_alias) $(target_alias) version.c
295295

296296
#

‎sim/common/create-version.sh‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
3+
# Copyright (C) 1989-2019 Free Software Foundation, Inc.
4+
5+
# This file is part of GDB.
6+
7+
# This program is free software; you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation; either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
20+
# Create version.c from version.in.
21+
# Usage:
22+
# create-version.sh PATH-TO-GDB-SRCDIR HOST_ALIAS \
23+
# TARGET_ALIAS OUTPUT-FILE-NAME
24+
25+
srcdir="$1"
26+
host_alias="$2"
27+
target_alias="$3"
28+
output="$4"
29+
30+
rm -f version.c-tmp $output version.tmp
31+
date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
32+
sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp
33+
echo '#include "version.h"' >> version.c-tmp
34+
echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
35+
echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp
36+
echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp
37+
mv version.c-tmp $output
38+
rm -f version.tmp

‎sim/ppc/ChangeLog‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2019-01-26 Tom Tromey <tom@tromey.com>
2+
3+
* Makefile.in (version.c): Use sim's create-version.sh.
4+
15
2018-05-09 Sebastian Rasmussen <sebras@gmail.com>
26

37
* e500_registers.h: Comment typo fix.

‎sim/ppc/Makefile.in‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ $(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ)
548548
$(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
549549
$(RANLIB) $(TARGETLIB)
550550

551-
version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/gdb/common/create-version.sh
552-
$(SHELL) $(srcroot)/gdb/common/create-version.sh $(srcroot)/gdb \
551+
version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/sim/common/create-version.sh
552+
$(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb \
553553
$(host_alias) $(target_alias) version.c
554554
version.o: version.c $(version_h)
555555

0 commit comments

Comments
 (0)