public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] Add do-release.sh
  2019-01-01  0:00 [PATCH] Add do-release.sh Tom de Vries
@ 2019-01-01  0:00 ` Jakub Jelinek
  2019-01-01  0:00   ` Tom de Vries
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jakub Jelinek @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Tom de Vries; +Cc: dwz

On Mon, Jul 22, 2019 at 09:41:33AM +0200, Tom de Vries wrote:
> Hi,
> 
> this commit adds a script that:
> - bumps either the minor or the major version, using options
>   --major or --minor
> - updates VERSION
> - commits VERSION update
> - tags VERSION update
> 
> OK for trunk?
> 
> Is there anything else involved in doing a release?

I think that is all, bumping VERSION, commiting and tagging was all I did in
the past.

One thing that might be worth doing is bump copyright years on files you've
modified, I know dwz.c has been using mostly Red Hat copyright, if you want
to use say FSF copyright, can you change that 2003 in there to 2003, 2019?
Or do you want to use SUSE copyright instead?
I guess because I have touched dwz.c last year the RH copyright should be
-2018 instead of -2015 too, and dwarf2.def should be probably changed to
1992-2018 FSF copyright, using the simple range.  After the release we
should likely import new dwarf2.def and dwarf2.h from GCC tree.

	Jakub

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Add do-release.sh
  2019-01-01  0:00   ` Tom de Vries
  2019-01-01  0:00     ` Jakub Jelinek
@ 2019-01-01  0:00     ` Michael Matz
  1 sibling, 0 replies; 10+ messages in thread
From: Michael Matz @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Jakub Jelinek, dwz

Hi,

On Thu, 1 Aug 2019, Tom de Vries wrote:

> > One thing that might be worth doing is bump copyright years on files you've
> > modified, I know dwz.c has been using mostly Red Hat copyright, if you want
> > to use say FSF copyright, can you change that 2003 in there to 2003, 2019?
> > Or do you want to use SUSE copyright instead?
> 
> It seems I have to use the SUSE copyright.

Maybe background on this: 

The FSF generally accepts copyright assignment only for FSF-copyrighted 
GNU software (http://www.gnu.org/philosophy/categories.html#GNUsoftware, 
and the following paragraph), and dwz is no GNU software 
(https://directory.fsf.org/wiki/GNU), even if it uses the GPL.

So, technically, because of the impossible assignment, the copyright 
remains with whomever wrote the code initially.  If dwz were 
FSF-copyrighted software we would have preferred the FSF attribution in 
this case.

(Of course, in the end, this is all fairly minor ;-) )


Ciao,
Michael.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Add do-release.sh
  2019-01-01  0:00 ` Jakub Jelinek
@ 2019-01-01  0:00   ` Tom de Vries
  2019-01-01  0:00     ` Jakub Jelinek
  2019-01-01  0:00     ` Michael Matz
  2019-01-01  0:00   ` [committed] Copy dwarf2.def, dwarf2.h and dwarfnames.c from gcc Tom de Vries
  2019-01-01  0:00   ` [PATCH] Add do-release.sh Tom de Vries
  2 siblings, 2 replies; 10+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: dwz, Michael Matz

[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]

On 29-07-19 19:20, Jakub Jelinek wrote:
> On Mon, Jul 22, 2019 at 09:41:33AM +0200, Tom de Vries wrote:
>> Hi,
>>
>> this commit adds a script that:
>> - bumps either the minor or the major version, using options
>>   --major or --minor
>> - updates VERSION
>> - commits VERSION update
>> - tags VERSION update
>>
>> OK for trunk?
>>
>> Is there anything else involved in doing a release?
> 
> I think that is all, bumping VERSION, commiting and tagging was all I did in
> the past.
> 
> One thing that might be worth doing is bump copyright years on files you've
> modified, I know dwz.c has been using mostly Red Hat copyright, if you want
> to use say FSF copyright, can you change that 2003 in there to 2003, 2019?
> Or do you want to use SUSE copyright instead?

It seems I have to use the SUSE copyright.

> I guess because I have touched dwz.c last year the RH copyright should be
> -2018 instead of -2015 too,

Done.

> and dwarf2.def should be probably changed to
> 1992-2018 FSF copyright, using the simple range.

Done. [ Although, in the dwz.c file you've used 2003 as the FSF
copyright year, due to the contribution date of strrevcmp to
bfd/merge.c. So, using the same logic, we would have to use 2017 as the
FSF copyright year for the 2018 dwz commit which backports a change of
<gcc repo>/include/dwarf2.def from 2017. ]

Also, I've added 2016 to FSF copyright for hashtab.c due to a backport
of code contributed to the gcc repo in 2016. But perhaps that needs to
be 2019?

>  After the release we
> should likely import new dwarf2.def and dwarf2.h from GCC tree.

Agreed.

OK like this?

Thanks,
- Tom


[-- Attachment #2: 0001-Update-copyright.patch --]
[-- Type: text/x-patch, Size: 1550 bytes --]

Update copyright

2019-08-01  Tom de Vries  <tdevries@suse.de>

	* dwarf2.def: Update copyright.
	* dwz.c: Same.
	* hashtab.c: Same.

---
 dwarf2.def | 3 +--
 dwz.c      | 3 ++-
 hashtab.c  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dwarf2.def b/dwarf2.def
index 17311fa..e308ba7 100644
--- a/dwarf2.def
+++ b/dwarf2.def
@@ -1,8 +1,7 @@
 /* -*- c -*-
    Declarations and definitions of codes relating to the DWARF2 and
    DWARF3 symbolic debugging information formats.
-   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+   Copyright (C) 1992-2018
    Free Software Foundation, Inc.
 
    Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
diff --git a/dwz.c b/dwz.c
index 577ea2c..266f56d 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2001-2015 Red Hat, Inc.
+/* Copyright (C) 2001-2018 Red Hat, Inc.
    Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2019 SUSE LLC.
    Written by Jakub Jelinek <jakub@redhat.com>, 2012.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/hashtab.c b/hashtab.c
index a1da33e..59600c0 100644
--- a/hashtab.c
+++ b/hashtab.c
@@ -1,5 +1,5 @@
 /* An expandable hash tables datatype.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2016
    Free Software Foundation, Inc.
    Contributed by Vladimir Makarov (vmakarov@cygnus.com).
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Add do-release.sh
  2019-01-01  0:00     ` Jakub Jelinek
@ 2019-01-01  0:00       ` Tom de Vries
  0 siblings, 0 replies; 10+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: dwz, Michael Matz

[-- Attachment #1: Type: text/plain, Size: 1631 bytes --]

On 01-08-19 17:19, Jakub Jelinek wrote:
> On Thu, Aug 01, 2019 at 05:13:21PM +0200, Tom de Vries wrote:
>> --- a/dwarf2.def
>> +++ b/dwarf2.def
>> @@ -1,8 +1,7 @@
>>  /* -*- c -*-
>>     Declarations and definitions of codes relating to the DWARF2 and
>>     DWARF3 symbolic debugging information formats.
>> -   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
>> -   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
>> +   Copyright (C) 1992-2018
>>     Free Software Foundation, Inc.
> 
> I'd remove the line break, with the year range it fits well on one line.
> 
>> --- a/dwz.c
>> +++ b/dwz.c
>> @@ -1,5 +1,6 @@
>> -/* Copyright (C) 2001-2015 Red Hat, Inc.
>> +/* Copyright (C) 2001-2018 Red Hat, Inc.
>>     Copyright (C) 2003 Free Software Foundation, Inc.
>> +   Copyright (C) 2019 SUSE LLC.
>>     Written by Jakub Jelinek <jakub@redhat.com>, 2012.
>>  
>>     This program is free software; you can redistribute it and/or modify
>> diff --git a/hashtab.c b/hashtab.c
>> index a1da33e..59600c0 100644
>> --- a/hashtab.c
>> +++ b/hashtab.c
>> @@ -1,5 +1,5 @@
>>  /* An expandable hash tables datatype.
>> -   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010
>> +   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2016
>>     Free Software Foundation, Inc.
> 
> And here I'd again use a range and one line.
> 
>>     Contributed by Vladimir Makarov (vmakarov@cygnus.com).
> 
> LGTM otherwise.

Committed as below.

I've also used 2017 instead 2018 in dwarf2.def, after reading up a bit
on this I think this is the appropriate thing to do.

Thanks,
- Tom

Thanks,
- Tom

[-- Attachment #2: 0001-Update-copyright.patch --]
[-- Type: text/x-patch, Size: 1686 bytes --]

Update copyright

2019-08-01  Tom de Vries  <tdevries@suse.de>

	* dwarf2.def: Update copyright.
	* dwz.c: Same.
	* hashtab.c: Same.

---
 dwarf2.def | 4 +---
 dwz.c      | 3 ++-
 hashtab.c  | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/dwarf2.def b/dwarf2.def
index 17311fa..5cc84b9 100644
--- a/dwarf2.def
+++ b/dwarf2.def
@@ -1,9 +1,7 @@
 /* -*- c -*-
    Declarations and definitions of codes relating to the DWARF2 and
    DWARF3 symbolic debugging information formats.
-   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 1992-2017 Free Software Foundation, Inc.
 
    Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
    Office (AJPO), Florida State University and Silicon Graphics Inc.
diff --git a/dwz.c b/dwz.c
index 577ea2c..266f56d 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2001-2015 Red Hat, Inc.
+/* Copyright (C) 2001-2018 Red Hat, Inc.
    Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2019 SUSE LLC.
    Written by Jakub Jelinek <jakub@redhat.com>, 2012.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/hashtab.c b/hashtab.c
index a1da33e..5d98451 100644
--- a/hashtab.c
+++ b/hashtab.c
@@ -1,6 +1,5 @@
 /* An expandable hash tables datatype.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
    Contributed by Vladimir Makarov (vmakarov@cygnus.com).
 
 This file is part of the libiberty library.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] Add do-release.sh
@ 2019-01-01  0:00 Tom de Vries
  2019-01-01  0:00 ` Jakub Jelinek
  0 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

this commit adds a script that:
- bumps either the minor or the major version, using options
  --major or --minor
- updates VERSION
- commits VERSION update
- tags VERSION update

OK for trunk?

Is there anything else involved in doing a release?

Thanks,
- Tom

Add do-release.sh

2019-07-22  Tom de Vries  <tdevries@suse.de>

	* do-release.sh: New file.

---
 do-release.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/do-release.sh b/do-release.sh
new file mode 100755
index 0000000..f1bb4d9
--- /dev/null
+++ b/do-release.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+set -e
+
+do_minor=false
+do_major=false
+
+while [ $# -gt 0 ]; do
+    case "$1" in
+	--minor)
+	    do_minor=true
+	    ;;
+	--major)
+	    do_major=true
+	    ;;
+	*)
+	    echo "Unknown option: $1"
+	    exit 1
+    esac
+    shift
+done
+
+if $do_minor && $do_major; then
+    echo "Can only bump minor or major, not both"
+    exit 1
+fi
+
+if ! $do_minor && ! $do_major; then
+    echo "Need to bump minor or major"
+    exit 1
+fi
+
+git checkout master
+
+version=$(cat VERSION)
+
+minor=$(echo $version \
+	    | sed 's/.*\.//')
+major=$(echo $version \
+	    | sed 's/\..*//')
+echo Current version: major: $major,  minor: $minor
+
+if $do_minor; then
+    echo "Bumping minor version"
+    minor=$(($minor + 1))
+elif $do_major; then
+    echo "Bumping major version"
+    major=$(($major + 1))
+    minor=0
+fi
+echo Bumped version: major: $major,  minor: $minor
+
+version=$major.$minor
+
+echo $version > VERSION
+
+git add VERSION
+
+git commit -m "Bump version to $version"
+
+git tag dwz-$version

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [committed] Copy dwarf2.def, dwarf2.h and dwarfnames.c from gcc
  2019-01-01  0:00 ` Jakub Jelinek
  2019-01-01  0:00   ` Tom de Vries
@ 2019-01-01  0:00   ` Tom de Vries
  2019-01-01  0:00   ` [PATCH] Add do-release.sh Tom de Vries
  2 siblings, 0 replies; 10+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: dwz

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

[ was: Re: [PATCH] Add do-release.sh ]

On 29-07-19 19:20, Jakub Jelinek wrote:
> After the release we
> should likely import new dwarf2.def and dwarf2.h from GCC tree.

Done.

Thanks,
- Tom

[-- Attachment #2: 0001-Copy-dwarf2.def-dwarf2.h-and-dwarfnames.c-from-gcc.patch --]
[-- Type: text/x-patch, Size: 18323 bytes --]

Copy dwarf2.def, dwarf2.h and dwarfnames.c from gcc

Copy dwarf2.def, dwarf2.h and dwarfnames.c from gcc trunk@274006.

2019-08-02  Tom de Vries  <tdevries@suse.de>

	* dwarf2.def: Copy from gcc trunk@274006.
	* dwarf2.h: Same.
	* dwarfnames.c: Same.

---
 dwarf2.def   | 128 ++++++++++++++++++++++++++++++++++++++++++--
 dwarf2.h     | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 dwarfnames.c |  15 +++++-
 3 files changed, 294 insertions(+), 18 deletions(-)

diff --git a/dwarf2.def b/dwarf2.def
index 5cc84b9..9cce1f8 100644
--- a/dwarf2.def
+++ b/dwarf2.def
@@ -1,7 +1,7 @@
 /* -*- c -*-
    Declarations and definitions of codes relating to the DWARF2 and
    DWARF3 symbolic debugging information formats.
-   Copyright (C) 1992-2017 Free Software Foundation, Inc.
+   Copyright (C) 1992-2019 Free Software Foundation, Inc.
 
    Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
    Office (AJPO), Florida State University and Silicon Graphics Inc.
@@ -131,6 +131,15 @@ DW_TAG (DW_TAG_shared_type, 0x40)
 DW_TAG (DW_TAG_type_unit, 0x41)
 DW_TAG (DW_TAG_rvalue_reference_type, 0x42)
 DW_TAG (DW_TAG_template_alias, 0x43)
+/* DWARF 5.  */
+DW_TAG (DW_TAG_coarray_type, 0x44)
+DW_TAG (DW_TAG_generic_subrange, 0x45)
+DW_TAG (DW_TAG_dynamic_type, 0x46)
+DW_TAG (DW_TAG_atomic_type, 0x47)
+DW_TAG (DW_TAG_call_site, 0x48)
+DW_TAG (DW_TAG_call_site_parameter, 0x49)
+DW_TAG (DW_TAG_skeleton_unit, 0x4a)
+DW_TAG (DW_TAG_immutable_type, 0x4b)
 
 DW_TAG_DUP (DW_TAG_lo_user, 0x4080)
 DW_TAG_DUP (DW_TAG_hi_user, 0xffff)
@@ -200,6 +209,25 @@ DW_FORM (DW_FORM_sec_offset, 0x17)
 DW_FORM (DW_FORM_exprloc, 0x18)
 DW_FORM (DW_FORM_flag_present, 0x19)
 DW_FORM (DW_FORM_ref_sig8, 0x20)
+/* DWARF 5.  */
+DW_FORM (DW_FORM_strx, 0x1a)
+DW_FORM (DW_FORM_addrx, 0x1b)
+DW_FORM (DW_FORM_ref_sup4, 0x1c)
+DW_FORM (DW_FORM_strp_sup, 0x1d)
+DW_FORM (DW_FORM_data16, 0x1e)
+DW_FORM (DW_FORM_line_strp, 0x1f)
+DW_FORM (DW_FORM_implicit_const, 0x21)
+DW_FORM (DW_FORM_loclistx, 0x22)
+DW_FORM (DW_FORM_rnglistx, 0x23)
+DW_FORM (DW_FORM_ref_sup8, 0x24)
+DW_FORM (DW_FORM_strx1, 0x25)
+DW_FORM (DW_FORM_strx2, 0x26)
+DW_FORM (DW_FORM_strx3, 0x27)
+DW_FORM (DW_FORM_strx4, 0x28)
+DW_FORM (DW_FORM_addrx1, 0x29)
+DW_FORM (DW_FORM_addrx2, 0x2a)
+DW_FORM (DW_FORM_addrx3, 0x2b)
+DW_FORM (DW_FORM_addrx4, 0x2c)
 /* Extensions for Fission.  See http://gcc.gnu.org/wiki/DebugFission.  */
 DW_FORM (DW_FORM_GNU_addr_index, 0x1f01)
 DW_FORM (DW_FORM_GNU_str_index, 0x1f02)
@@ -306,6 +334,36 @@ DW_AT (DW_AT_data_bit_offset, 0x6b)
 DW_AT (DW_AT_const_expr, 0x6c)
 DW_AT (DW_AT_enum_class, 0x6d)
 DW_AT (DW_AT_linkage_name, 0x6e)
+/* DWARF 5.  */
+DW_AT (DW_AT_string_length_bit_size, 0x6f)
+DW_AT (DW_AT_string_length_byte_size, 0x70)
+DW_AT (DW_AT_rank, 0x71)
+DW_AT (DW_AT_str_offsets_base, 0x72)
+DW_AT (DW_AT_addr_base, 0x73)
+DW_AT (DW_AT_rnglists_base, 0x74)
+DW_AT (DW_AT_dwo_name, 0x76)
+DW_AT (DW_AT_reference, 0x77)
+DW_AT (DW_AT_rvalue_reference, 0x78)
+DW_AT (DW_AT_macros, 0x79)
+DW_AT (DW_AT_call_all_calls, 0x7a)
+DW_AT (DW_AT_call_all_source_calls, 0x7b)
+DW_AT (DW_AT_call_all_tail_calls, 0x7c)
+DW_AT (DW_AT_call_return_pc, 0x7d)
+DW_AT (DW_AT_call_value, 0x7e)
+DW_AT (DW_AT_call_origin, 0x7f)
+DW_AT (DW_AT_call_parameter, 0x80)
+DW_AT (DW_AT_call_pc, 0x81)
+DW_AT (DW_AT_call_tail_call, 0x82)
+DW_AT (DW_AT_call_target, 0x83)
+DW_AT (DW_AT_call_target_clobbered, 0x84)
+DW_AT (DW_AT_call_data_location, 0x85)
+DW_AT (DW_AT_call_data_value, 0x86)
+DW_AT (DW_AT_noreturn, 0x87)
+DW_AT (DW_AT_alignment, 0x88)
+DW_AT (DW_AT_export_symbols, 0x89)
+DW_AT (DW_AT_deleted, 0x8a)
+DW_AT (DW_AT_defaulted, 0x8b)
+DW_AT (DW_AT_loclists_base, 0x8c)
 
 DW_AT_DUP (DW_AT_lo_user, 0x2000) /* Implementation-defined range start.  */
 DW_AT_DUP (DW_AT_hi_user, 0x3fff) /* Implementation-defined range end.  */
@@ -381,6 +439,8 @@ DW_AT (DW_AT_GNU_all_call_sites, 0x2117)
 DW_AT (DW_AT_GNU_all_source_call_sites, 0x2118)
 /* Section offset into .debug_macro section.  */
 DW_AT (DW_AT_GNU_macros, 0x2119)
+/* Attribute for C++ deleted special member functions (= delete;).  */
+DW_AT (DW_AT_GNU_deleted, 0x211a)
 /* Extensions for Fission.  See http://gcc.gnu.org/wiki/DebugFission.  */
 DW_AT (DW_AT_GNU_dwo_name, 0x2130)
 DW_AT (DW_AT_GNU_dwo_id, 0x2131)
@@ -388,6 +448,11 @@ DW_AT (DW_AT_GNU_ranges_base, 0x2132)
 DW_AT (DW_AT_GNU_addr_base, 0x2133)
 DW_AT (DW_AT_GNU_pubnames, 0x2134)
 DW_AT (DW_AT_GNU_pubtypes, 0x2135)
+/* Attribute for discriminator.
+   See http://gcc.gnu.org/wiki/Discriminator  */
+DW_AT (DW_AT_GNU_discriminator, 0x2136)
+DW_AT (DW_AT_GNU_locviews, 0x2137)
+DW_AT (DW_AT_GNU_entry_view, 0x2138)
 /* VMS extensions.  */
 DW_AT (DW_AT_VMS_rtnbeg_pd_address, 0x2201)
 /* GNAT extensions.  */
@@ -395,12 +460,33 @@ DW_AT (DW_AT_VMS_rtnbeg_pd_address, 0x2201)
    See http://gcc.gnu.org/wiki/DW_AT_GNAT_descriptive_type .  */
 DW_AT (DW_AT_use_GNAT_descriptive_type, 0x2301)
 DW_AT (DW_AT_GNAT_descriptive_type, 0x2302)
+/* Rational constant extension.
+   See https://gcc.gnu.org/wiki/DW_AT_GNU_numerator_denominator .  */
+DW_TAG (DW_AT_GNU_numerator, 0x2303)
+DW_TAG (DW_AT_GNU_denominator, 0x2304)
+/* Biased integer extension.
+   See https://gcc.gnu.org/wiki/DW_AT_GNU_bias .  */
+DW_TAG (DW_AT_GNU_bias, 0x2305)
 /* UPC extension.  */
 DW_AT (DW_AT_upc_threads_scaled, 0x3210)
 /* PGI (STMicroelectronics) extensions.  */
 DW_AT (DW_AT_PGI_lbase, 0x3a00)
 DW_AT (DW_AT_PGI_soffset, 0x3a01)
 DW_AT (DW_AT_PGI_lstride, 0x3a02)
+/* Apple extensions.  */
+DW_AT (DW_AT_APPLE_optimized, 0x3fe1)
+DW_AT (DW_AT_APPLE_flags, 0x3fe2)
+DW_AT (DW_AT_APPLE_isa, 0x3fe3)
+DW_AT (DW_AT_APPLE_block, 0x3fe4)
+DW_AT (DW_AT_APPLE_major_runtime_vers, 0x3fe5)
+DW_AT (DW_AT_APPLE_runtime_class, 0x3fe6)
+DW_AT (DW_AT_APPLE_omit_frame_ptr, 0x3fe7)
+DW_AT (DW_AT_APPLE_property_name, 0x3fe8)
+DW_AT (DW_AT_APPLE_property_getter, 0x3fe9)
+DW_AT (DW_AT_APPLE_property_setter, 0x3fea)
+DW_AT (DW_AT_APPLE_property_attribute, 0x3feb)
+DW_AT (DW_AT_APPLE_objc_complete_type, 0x3fec)
+DW_AT (DW_AT_APPLE_property, 0x3fed)
 DW_END_AT
 
 DW_FIRST_OP (DW_OP_addr, 0x03)
@@ -561,6 +647,18 @@ DW_OP (DW_OP_bit_piece, 0x9d)
 DW_OP (DW_OP_implicit_value, 0x9e)
 DW_OP (DW_OP_stack_value, 0x9f)
 
+/* DWARF 5 extensions.  */
+DW_OP (DW_OP_implicit_pointer, 0xa0)
+DW_OP (DW_OP_addrx, 0xa1)
+DW_OP (DW_OP_constx, 0xa2)
+DW_OP (DW_OP_entry_value, 0xa3)
+DW_OP (DW_OP_const_type, 0xa4)
+DW_OP (DW_OP_regval_type, 0xa5)
+DW_OP (DW_OP_deref_type, 0xa6)
+DW_OP (DW_OP_xderef_type, 0xa7)
+DW_OP (DW_OP_convert, 0xa8)
+DW_OP (DW_OP_reinterpret, 0xa9)
+
 DW_OP_DUP (DW_OP_lo_user, 0xe0)	/* Implementation-defined range start.  */
 DW_OP_DUP (DW_OP_hi_user, 0xff)	/* Implementation-defined range end.  */
 
@@ -584,8 +682,9 @@ DW_OP (DW_OP_GNU_convert, 0xf7)
 DW_OP (DW_OP_GNU_reinterpret, 0xf9)
 /* The GNU parameter ref extension.  */
 DW_OP (DW_OP_GNU_parameter_ref, 0xfa)
-/* Extension for Fission.  See http://gcc.gnu.org/wiki/DebugFission.  */
+/* Extensions for Fission.  See http://gcc.gnu.org/wiki/DebugFission.  */
 DW_OP (DW_OP_GNU_addr_index, 0xfb)
+DW_OP (DW_OP_GNU_const_index, 0xfc)
 /* The GNU variable value extension.
    See http://dwarfstd.org/ShowIssue.php?issue=161109.2 . */
 DW_OP (DW_OP_GNU_variable_value, 0xfd)
@@ -599,6 +698,12 @@ DW_OP (DW_OP_HP_unmod_range, 0xe5)
 DW_OP (DW_OP_HP_tls, 0xe6)
 /* PGI (STMicroelectronics) extensions.  */
 DW_OP (DW_OP_PGI_omp_thread_num, 0xf8)
+/* AARCH64 extensions.
+   DW_OP_AARCH64_operation takes one mandatory unsigned LEB128 operand.
+   Bits[6:0] of this operand is the action code, all others bits are initialized
+   to 0 except explicitly documented for one action.  Please refer AArch64 DWARF
+   ABI documentation for details.  */
+DW_OP (DW_OP_AARCH64_operation, 0xea)
 DW_END_OP
 
 DW_FIRST_ATE (DW_ATE_void, 0x0)
@@ -620,6 +725,9 @@ DW_ATE (DW_ATE_unsigned_fixed, 0xe)
 DW_ATE (DW_ATE_decimal_float, 0xf)
 /* DWARF 4.  */
 DW_ATE (DW_ATE_UTF, 0x10)
+/* DWARF 5.  */
+DW_ATE (DW_ATE_UCS, 0x11)
+DW_ATE (DW_ATE_ASCII, 0x12)
 
 DW_ATE_DUP (DW_ATE_lo_user, 0x80)
 DW_ATE_DUP (DW_ATE_hi_user, 0xff)
@@ -677,9 +785,23 @@ DW_CFA (DW_CFA_hi_user, 0x3f)
 
 /* SGI/MIPS specific.  */
 DW_CFA (DW_CFA_MIPS_advance_loc8, 0x1d)
-/* GNU extensions.  */
+/* GNU extensions.
+   NOTE: DW_CFA_GNU_window_save is multiplexed on Sparc and AArch64.  */
 DW_CFA (DW_CFA_GNU_window_save, 0x2d)
+DW_CFA_DUP (DW_CFA_AARCH64_negate_ra_state, 0x2d)
 DW_CFA (DW_CFA_GNU_args_size, 0x2e)
 DW_CFA (DW_CFA_GNU_negative_offset_extended, 0x2f)
 
 DW_END_CFA
+
+/* Index attributes in the Abbreviations Table.  */
+DW_FIRST_IDX (DW_IDX_compile_unit, 1)
+DW_IDX (DW_IDX_type_unit, 2)
+DW_IDX (DW_IDX_die_offset, 3)
+DW_IDX (DW_IDX_parent, 4)
+DW_IDX (DW_IDX_type_hash, 5)
+DW_IDX_DUP (DW_IDX_lo_user, 0x2000)
+DW_IDX (DW_IDX_hi_user, 0x3fff)
+DW_IDX (DW_IDX_GNU_internal, 0x2000)
+DW_IDX (DW_IDX_GNU_external, 0x2001)
+DW_END_IDX
diff --git a/dwarf2.h b/dwarf2.h
index 2c1aeb6..e03349d 100644
--- a/dwarf2.h
+++ b/dwarf2.h
@@ -1,8 +1,6 @@
 /* Declarations and definitions of codes relating to the DWARF2 and
    DWARF3 symbolic debugging information formats.
-   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 1992-2019 Free Software Foundation, Inc.
 
    Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
    Office (AJPO), Florida State University and Silicon Graphics Inc.
@@ -54,6 +52,9 @@
 #define DW_ATE(name, value) , name = value
 #define DW_ATE_DUP(name, value) , name = value
 #define DW_CFA(name, value) , name = value
+#define DW_CFA_DUP(name, value) , name = value
+#define DW_IDX(name, value) , name = value
+#define DW_IDX_DUP(name, value) , name = value
 
 #define DW_FIRST_TAG(name, value) enum dwarf_tag { \
   name = value
@@ -73,6 +74,9 @@
 #define DW_FIRST_CFA(name, value) enum dwarf_call_frame_info { \
   name = value
 #define DW_END_CFA };
+#define DW_FIRST_IDX(name, value) enum dwarf_name_index_attribute { \
+  name = value
+#define DW_END_IDX };
 
 #include "dwarf2.def"
 
@@ -88,6 +92,8 @@
 #undef DW_END_ATE
 #undef DW_FIRST_CFA
 #undef DW_END_CFA
+#undef DW_FIRST_IDX
+#undef DW_END_IDX
 
 #undef DW_TAG
 #undef DW_TAG_DUP
@@ -99,6 +105,9 @@
 #undef DW_ATE
 #undef DW_ATE_DUP
 #undef DW_CFA
+#undef DW_CFA_DUP
+#undef DW_IDX
+#undef DW_IDX_DUP
 
 /* Flag that tells whether entry has a child or not.  */
 #define DW_children_no   0
@@ -177,6 +186,10 @@ enum dwarf_calling_convention
     DW_CC_program = 0x2,
     DW_CC_nocall = 0x3,
 
+    /* DWARF 5.  */
+    DW_CC_pass_by_reference = 0x4,
+    DW_CC_pass_by_value = 0x5,
+
     DW_CC_lo_user = 0x40,
     DW_CC_hi_user = 0xff,
 
@@ -259,6 +272,48 @@ enum dwarf_line_number_hp_sfc_ops
     DW_LNE_HP_SFC_associate = 3
   };
 
+/* Content type codes in line table directory_entry_format
+   and file_name_entry_format sequences.  */
+enum dwarf_line_number_content_type
+  {
+    DW_LNCT_path = 0x1,
+    DW_LNCT_directory_index = 0x2,
+    DW_LNCT_timestamp = 0x3,
+    DW_LNCT_size = 0x4,
+    DW_LNCT_MD5 = 0x5,
+    DW_LNCT_lo_user = 0x2000,
+    DW_LNCT_hi_user = 0x3fff
+  };
+
+/* Type codes for location list entries.  */
+enum dwarf_location_list_entry_type
+  {
+    DW_LLE_end_of_list = 0x00,
+    DW_LLE_base_addressx = 0x01,
+    DW_LLE_startx_endx = 0x02,
+    DW_LLE_startx_length = 0x03,
+    DW_LLE_offset_pair = 0x04,
+    DW_LLE_default_location = 0x05,
+    DW_LLE_base_address = 0x06,
+    DW_LLE_start_end = 0x07,
+    DW_LLE_start_length = 0x08,
+
+    /* <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/2017-April/004347.html>
+       has the proposal for now; only available to list members.
+
+       A (possibly updated) copy of the proposal is available at
+       <http://people.redhat.com/aoliva/papers/sfn/dwarf6-sfn-lvu.txt>.  */
+    DW_LLE_GNU_view_pair = 0x09,
+#define DW_LLE_view_pair DW_LLE_GNU_view_pair
+
+    /* Former extension for Fission.
+       See http://gcc.gnu.org/wiki/DebugFission.  */
+    DW_LLE_GNU_end_of_list_entry = 0x00,
+    DW_LLE_GNU_base_address_selection_entry = 0x01,
+    DW_LLE_GNU_start_end_entry = 0x02,
+    DW_LLE_GNU_start_length_entry = 0x03
+  };
+
 #define DW_CIE_ID	  0xffffffff
 #define DW64_CIE_ID	  0xffffffffffffffffULL
 #define DW_CIE_VERSION	  1
@@ -296,7 +351,22 @@ enum dwarf_source_language
     /* DWARF 4.  */
     DW_LANG_Python = 0x0014,
     /* DWARF 5.  */
+    DW_LANG_OpenCL = 0x0015,
     DW_LANG_Go = 0x0016,
+    DW_LANG_Modula3 = 0x0017,
+    DW_LANG_Haskell = 0x0018,
+    DW_LANG_C_plus_plus_03 = 0x0019,
+    DW_LANG_C_plus_plus_11 = 0x001a,
+    DW_LANG_OCaml = 0x001b,
+    DW_LANG_Rust = 0x001c,
+    DW_LANG_C11 = 0x001d,
+    DW_LANG_Swift = 0x001e,
+    DW_LANG_Julia = 0x001f,
+    DW_LANG_Dylan = 0x0020,
+    DW_LANG_C_plus_plus_14 = 0x0021,
+    DW_LANG_Fortran03 = 0x0022,
+    DW_LANG_Fortran08 = 0x0023,
+    DW_LANG_RenderScript = 0x0024,
 
     DW_LANG_lo_user = 0x8000,	/* Implementation-defined range start.  */
     DW_LANG_hi_user = 0xffff,	/* Implementation-defined range start.  */
@@ -310,7 +380,10 @@ enum dwarf_source_language
     DW_LANG_HP_Basic91   = 0x8004,
     DW_LANG_HP_Pascal91  = 0x8005,
     DW_LANG_HP_IMacro    = 0x8006,
-    DW_LANG_HP_Assembler = 0x8007
+    DW_LANG_HP_Assembler = 0x8007,
+
+    /* Rust extension, but replaced in DWARF 5.  */
+    DW_LANG_Rust_old = 0x9000
   };
 
 /* Names and codes for macro information.  */
@@ -323,24 +396,74 @@ enum dwarf_macinfo_record_type
     DW_MACINFO_vendor_ext = 255
   };
 
+/* DW_TAG_defaulted/DW_TAG_GNU_defaulted attributes.  */
+enum dwarf_defaulted_attribute
+  {
+    DW_DEFAULTED_no = 0x00,
+    DW_DEFAULTED_in_class = 0x01,
+    DW_DEFAULTED_out_of_class = 0x02
+  };
+
 /* Names and codes for new style macro information.  */
 enum dwarf_macro_record_type
   {
-    DW_MACRO_GNU_define = 1,
-    DW_MACRO_GNU_undef = 2,
-    DW_MACRO_GNU_start_file = 3,
-    DW_MACRO_GNU_end_file = 4,
-    DW_MACRO_GNU_define_indirect = 5,
-    DW_MACRO_GNU_undef_indirect = 6,
-    DW_MACRO_GNU_transparent_include = 7,
+    DW_MACRO_define = 0x01,
+    DW_MACRO_undef = 0x02,
+    DW_MACRO_start_file = 0x03,
+    DW_MACRO_end_file = 0x04,
+    DW_MACRO_define_strp = 0x05,
+    DW_MACRO_undef_strp = 0x06,
+    DW_MACRO_import = 0x07,
+    DW_MACRO_define_sup = 0x08,
+    DW_MACRO_undef_sup = 0x09,
+    DW_MACRO_import_sup = 0x0a,
+    DW_MACRO_define_strx = 0x0b,
+    DW_MACRO_undef_strx = 0x0c,
+    DW_MACRO_lo_user = 0xe0,
+    DW_MACRO_hi_user = 0xff,
+
+    /* Compatibility macros for the GNU .debug_macro extension.  */
+    DW_MACRO_GNU_define = 0x01,
+    DW_MACRO_GNU_undef = 0x02,
+    DW_MACRO_GNU_start_file = 0x03,
+    DW_MACRO_GNU_end_file = 0x04,
+    DW_MACRO_GNU_define_indirect = 0x05,
+    DW_MACRO_GNU_undef_indirect = 0x06,
+    DW_MACRO_GNU_transparent_include = 0x07,
     /* Extensions for DWZ multifile.
        See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open .  */
-    DW_MACRO_GNU_define_indirect_alt = 8,
-    DW_MACRO_GNU_undef_indirect_alt = 9,
-    DW_MACRO_GNU_transparent_include_alt = 10,
+    DW_MACRO_GNU_define_indirect_alt = 0x08,
+    DW_MACRO_GNU_undef_indirect_alt = 0x09,
+    DW_MACRO_GNU_transparent_include_alt = 0x0a,
     DW_MACRO_GNU_lo_user = 0xe0,
     DW_MACRO_GNU_hi_user = 0xff
   };
+
+/* Range list entry kinds in .debug_rnglists* section.  */
+enum dwarf_range_list_entry
+  {
+    DW_RLE_end_of_list = 0x00,
+    DW_RLE_base_addressx = 0x01,
+    DW_RLE_startx_endx = 0x02,
+    DW_RLE_startx_length = 0x03,
+    DW_RLE_offset_pair = 0x04,
+    DW_RLE_base_address = 0x05,
+    DW_RLE_start_end = 0x06,
+    DW_RLE_start_length = 0x07
+  };
+
+/* Unit types in unit_type unit header field.  */
+enum dwarf_unit_type
+  {
+    DW_UT_compile = 0x01,
+    DW_UT_type = 0x02,
+    DW_UT_partial = 0x03,
+    DW_UT_skeleton = 0x04,
+    DW_UT_split_compile = 0x05,
+    DW_UT_split_type = 0x06,
+    DW_UT_lo_user = 0x80,
+    DW_UT_hi_user = 0xff
+  };
 \f
 /* @@@ For use with GNU frame unwind information.  */
 
@@ -365,6 +488,20 @@ enum dwarf_macro_record_type
 
 #define DW_EH_PE_indirect	0x80
 
+/* Codes for the debug sections in a dwarf package (.dwp) file.
+   Extensions for Fission.  See http://gcc.gnu.org/wiki/DebugFissionDWP.  */
+enum dwarf_sect
+  {
+    DW_SECT_INFO = 1,
+    DW_SECT_TYPES = 2,
+    DW_SECT_ABBREV = 3,
+    DW_SECT_LINE = 4,
+    DW_SECT_LOC = 5,
+    DW_SECT_STR_OFFSETS = 6,
+    DW_SECT_MACINFO = 7,
+    DW_SECT_MACRO = 8,
+    DW_SECT_MAX = 8
+  };
 
 #ifdef __cplusplus
 extern "C" {
@@ -394,6 +531,10 @@ extern const char *get_DW_ATE_name (unsigned int enc);
    recognized.  */
 extern const char *get_DW_CFA_name (unsigned int opc);
 
+/* Return the name of a DW_IDX_ constant, or NULL if the value is not
+   recognized.  */
+extern const char *get_DW_IDX_name (unsigned int idx);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/dwarfnames.c b/dwarfnames.c
index 7017308..c97741e 100644
--- a/dwarfnames.c
+++ b/dwarfnames.c
@@ -1,5 +1,5 @@
 /* Names of various DWARF tags.
-   Copyright (C) 2012 Free Software Foundation, Inc.
+   Copyright (C) 2012-2019 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
    
@@ -59,6 +59,11 @@ Boston, MA 02110-1301, USA.  */
   switch (opc) {					\
   DW_CFA (name, value)
 #define DW_END_CFA } return 0; }
+#define DW_FIRST_IDX(name, value) \
+  const char *get_DW_IDX_name (unsigned int idx) {	\
+  switch (idx) {					\
+  DW_IDX (name, value)
+#define DW_END_IDX } return 0; }
 
 #define DW_TAG(name, value) case name: return # name ;
 #define DW_TAG_DUP(name, value)
@@ -70,6 +75,9 @@ Boston, MA 02110-1301, USA.  */
 #define DW_ATE(name, value) case name: return # name ;
 #define DW_ATE_DUP(name, value)
 #define DW_CFA(name, value) case name: return # name ;
+#define DW_CFA_DUP(name, value)
+#define DW_IDX(name, value) case name: return # name ;
+#define DW_IDX_DUP(name, value)
 
 #include "dwarf2.def"
 
@@ -85,6 +93,8 @@ Boston, MA 02110-1301, USA.  */
 #undef DW_END_ATE
 #undef DW_FIRST_CFA
 #undef DW_END_CFA
+#undef DW_FIRST_IDX
+#undef DW_END_IDX
 
 #undef DW_TAG
 #undef DW_TAG_DUP
@@ -96,3 +106,6 @@ Boston, MA 02110-1301, USA.  */
 #undef DW_ATE
 #undef DW_ATE_DUP
 #undef DW_CFA
+#undef DW_CFA_DUP
+#undef DW_IDX
+#undef DW_IDX_DUP

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Add do-release.sh
  2019-01-01  0:00 ` Jakub Jelinek
  2019-01-01  0:00   ` Tom de Vries
  2019-01-01  0:00   ` [committed] Copy dwarf2.def, dwarf2.h and dwarfnames.c from gcc Tom de Vries
@ 2019-01-01  0:00   ` Tom de Vries
  2019-01-01  0:00     ` [committed] Update --version copyright message Tom de Vries
  2 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: dwz, Michael Matz

[-- Attachment #1: Type: text/plain, Size: 1652 bytes --]

On 29-07-19 19:20, Jakub Jelinek wrote:
> On Mon, Jul 22, 2019 at 09:41:33AM +0200, Tom de Vries wrote:
>> Hi,
>>
>> this commit adds a script that:
>> - bumps either the minor or the major version, using options
>>   --major or --minor
>> - updates VERSION
>> - commits VERSION update
>> - tags VERSION update
>>
>> OK for trunk?
>>
>> Is there anything else involved in doing a release?
> 
> I think that is all, bumping VERSION, commiting and tagging was all I did in
> the past.
> 
> One thing that might be worth doing is bump copyright years on files you've
> modified, I know dwz.c has been using mostly Red Hat copyright, if you want
> to use say FSF copyright, can you change that 2003 in there to 2003, 2019?
> Or do you want to use SUSE copyright instead?
> I guess because I have touched dwz.c last year the RH copyright should be
> -2018 instead of -2015 too, and dwarf2.def should be probably changed to
> 1992-2018 FSF copyright, using the simple range.  After the release we
> should likely import new dwarf2.def and dwarf2.h from GCC tree.

Hmm, something I overlooked:
...
$ ./dwz --version
dwz version 0.13
Copyright (C) 2001-2012 Red Hat, Inc.
Copyright (C) 2003 Free Software Foundation, Inc.
...

We've updated the copyright in the file headers, but not in the version
message.

Patch below fixes this, updating the message using the copyright from
the dwz.c file header.

I wonder though, what about the copyright in the other files:
dwarf2.def, dwarf2.h, dwarfnames.c, hashtab.c, hashtab.h, sha1.c and
sha1.h? Should we take the copyright in those files into account as
well? Or is it just dwz.c that matters?

Thanks,
- Tom




[-- Attachment #2: 0001-Update-version-copyright-message.patch --]
[-- Type: text/x-patch, Size: 953 bytes --]

Update --version copyright message

In commit 9a663b4 "Update copyright" we've updated copyright in the sources,
but not in the --version copyright message.

Update the --version copyright message.

2019-08-12  Tom de Vries  <tdevries@suse.de>

	* dwz.c (version): Update copyright message.

---
 dwz.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dwz.c b/dwz.c
index 266f56d..6f58134 100644
--- a/dwz.c
+++ b/dwz.c
@@ -12395,8 +12395,9 @@ version (void)
 {
   fprintf (stderr,
 	   "dwz version " DWZ_VERSION "\n"
-	   "Copyright (C) 2001-2012 Red Hat, Inc.\n"
+	   "Copyright (C) 2001-2018 Red Hat, Inc.\n"
 	   "Copyright (C) 2003 Free Software Foundation, Inc.\n"
+	   "Copyright (C) 2019 SUSE LLC."
 	   "This program is free software; you may redistribute it under the terms of\n"
 	   "the GNU General Public License version 3 or (at your option) any later version.\n"
 	   "This program has absolutely no warranty.\n");

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [committed] Update --version copyright message
  2019-01-01  0:00   ` [PATCH] Add do-release.sh Tom de Vries
@ 2019-01-01  0:00     ` Tom de Vries
  2019-01-01  0:00       ` Branch creation: dwz-0.13-branch Tom de Vries
  0 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: dwz, Michael Matz

[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]

[ was: Re: [PATCH] Add do-release.sh ]

On 12-08-19 17:18, Tom de Vries wrote:
> On 29-07-19 19:20, Jakub Jelinek wrote:
>> On Mon, Jul 22, 2019 at 09:41:33AM +0200, Tom de Vries wrote:
>>> Hi,
>>>
>>> this commit adds a script that:
>>> - bumps either the minor or the major version, using options
>>>   --major or --minor
>>> - updates VERSION
>>> - commits VERSION update
>>> - tags VERSION update
>>>
>>> OK for trunk?
>>>
>>> Is there anything else involved in doing a release?
>>
>> I think that is all, bumping VERSION, commiting and tagging was all I did in
>> the past.
>>
>> One thing that might be worth doing is bump copyright years on files you've
>> modified, I know dwz.c has been using mostly Red Hat copyright, if you want
>> to use say FSF copyright, can you change that 2003 in there to 2003, 2019?
>> Or do you want to use SUSE copyright instead?
>> I guess because I have touched dwz.c last year the RH copyright should be
>> -2018 instead of -2015 too, and dwarf2.def should be probably changed to
>> 1992-2018 FSF copyright, using the simple range.  After the release we
>> should likely import new dwarf2.def and dwarf2.h from GCC tree.
> 
> Hmm, something I overlooked:
> ...
> $ ./dwz --version
> dwz version 0.13
> Copyright (C) 2001-2012 Red Hat, Inc.
> Copyright (C) 2003 Free Software Foundation, Inc.
> ...
> 
> We've updated the copyright in the file headers, but not in the version
> message.
> 
> Patch below fixes this, updating the message using the copyright from
> the dwz.c file header.
> 
> I wonder though, what about the copyright in the other files:
> dwarf2.def, dwarf2.h, dwarfnames.c, hashtab.c, hashtab.h, sha1.c and
> sha1.h? Should we take the copyright in those files into account as
> well? Or is it just dwz.c that matters?

I've written a script that:
- extracts copyright lines from the source files,
- merges them, and
- writes out define flags to a new file COPYRIGHT_YEARS.

The version message now uses those defines.

Thanks,
- Tom

[-- Attachment #2: 0002-Update-version-copyright-message.patch --]
[-- Type: text/x-patch, Size: 6602 bytes --]

Update --version copyright message

In commit 9a663b4 "Update copyright" we've updated copyright in the sources,
but not in the --version copyright message.

Update the --version copyright message, using new script
contrib/gen-copyright-years.sh that extracts the copyright years from the
source files, and generates a file COPYRIGHT_YEARS containing define flags:
...
-DFSF_YEARS='"1992-2019"'
-DRH_YEARS='"2001-2018"'
-DSUSE_YEARS='"2019"'
...
resulting in:
...
$ dwz --version
dwz version 0.13
Copyright (C) 2001-2018 Red Hat, Inc.
Copyright (C) 1992-2019 Free Software Foundation, Inc.
Copyright (C) 2019 SUSE LLC.
...

2019-08-15  Tom de Vries  <tdevries@suse.de>

	* contrib/copyright-lines.awk: New file.
	* contrib/gen-copyright-years.sh: New file.
	* COPYRIGHT_YEARS: Generate.
	* Makefile (override CFLAGS +=, dwz-for-test): Add COPYRIGHT_YEARS
	defines.
	* dwz.c (version): Update copyright message using COPYRIGHT_YEARS
	defines.

---
 COPYRIGHT_YEARS                |   3 +
 Makefile                       |   6 +-
 contrib/copyright-lines.awk    |  27 +++++++
 contrib/gen-copyright-years.sh | 162 +++++++++++++++++++++++++++++++++++++++++
 dwz.c                          |   5 +-
 5 files changed, 199 insertions(+), 4 deletions(-)

diff --git a/COPYRIGHT_YEARS b/COPYRIGHT_YEARS
new file mode 100644
index 0000000..bcb248f
--- /dev/null
+++ b/COPYRIGHT_YEARS
@@ -0,0 +1,3 @@
+-DFSF_YEARS='"1992-2019"'
+-DRH_YEARS='"2001-2018"'
+-DSUSE_YEARS='"2019"'
diff --git a/Makefile b/Makefile
index 7e281e5..c945c9d 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,8 @@ srcdir=$(shell pwd)
 endif
 CFLAGS = -O2 -g
 DWZ_VERSION := $(shell cat $(srcdir)/VERSION)
-override CFLAGS += -Wall -W -D_FILE_OFFSET_BITS=64 -DDWZ_VERSION='"$(DWZ_VERSION)"'
+override CFLAGS += -Wall -W -D_FILE_OFFSET_BITS=64 \
+	-DDWZ_VERSION='"$(DWZ_VERSION)"' $(shell cat $(srcdir)/COPYRIGHT_YEARS)
 prefix = /usr
 exec_prefix = $(prefix)
 bindir = $(exec_prefix)/bin
@@ -52,7 +53,8 @@ DWZ_TEST_SOURCES := $(patsubst %.o,%-for-test.c,$(OBJECTS))
 
 dwz-for-test: $(DWZ_TEST_SOURCES)
 	$(CC) $(DWZ_TEST_SOURCES) -O2 -g -lelf -o $@ -Wall -W -DDEVEL \
-	  -D_FILE_OFFSET_BITS=64 -DDWZ_VERSION='"for-test"' -I$(srcdir)
+	  -D_FILE_OFFSET_BITS=64 -DDWZ_VERSION='"for-test"' -I$(srcdir) \
+	  $(shell cat $(srcdir)/COPYRIGHT_YEARS)
 
 min:
 	$(CC) $(TEST_SRC)/min.c $(TEST_SRC)/min-2.c -o $@ -g
diff --git a/contrib/copyright-lines.awk b/contrib/copyright-lines.awk
new file mode 100644
index 0000000..b031c50
--- /dev/null
+++ b/contrib/copyright-lines.awk
@@ -0,0 +1,27 @@
+BEGIN {
+    start=0
+}
+
+/Copyright \(C\).*[.]/ {
+    print
+    next
+}
+
+/Copyright \(C\)/ {
+    start=1
+    printf $0
+    next
+}
+
+/[.]/ {
+    if (start == 0)
+	next
+    print
+    start=0
+}
+
+// {
+    if (start == 0)
+	next
+    printf $0
+}
diff --git a/contrib/gen-copyright-years.sh b/contrib/gen-copyright-years.sh
new file mode 100755
index 0000000..1ef6f3f
--- /dev/null
+++ b/contrib/gen-copyright-years.sh
@@ -0,0 +1,162 @@
+#!/bin/bash
+
+this=$(basename $0)
+
+max ()
+{
+    local a
+    a=$1
+    local b
+    b=$2
+
+    if [ "$a" = "" ]; then
+	echo "$b"
+	return
+    elif [ "$b" = "" ]; then
+	echo "$a"
+	return
+    fi
+
+    if [ $a -gt $b ]; then
+        echo "$a"
+    else
+        echo "$b"
+    fi
+}
+
+min ()
+{
+    local a
+    a="$1"
+    local b
+    b="$2"
+
+    if [ "$a" = "" ]; then
+	echo "$b"
+	return
+    elif [ "$b" = "" ]; then
+	echo "$a"
+	return
+    fi
+
+    if [ $a -lt $b ]; then
+        echo "$a"
+    else
+        echo "$b"
+    fi
+}
+
+print_range () {
+    local a
+    a="$1"
+    local b
+    b="$2"
+
+    if [ "$a" = "$b" ]; then
+	echo "$a"
+	return
+    fi
+    echo "$a-$b"
+}
+
+process_line ()
+{
+    local line
+    line="$1"
+
+    fsf=false
+    rh=false
+    suse=false;
+
+    if echo "$line" \
+	    | grep -q "Free Software Foundation, Inc\."; then
+	fsf=true
+	who=fsf
+	line=$(echo "$line" \
+		   | sed 's/Free Software Foundation, Inc\.//')
+    elif echo "$line" \
+	    | grep -q "Red Hat, Inc\."; then
+	rh=true
+	who=rh
+	line=$(echo "$line" \
+		   | sed 's/Red Hat, Inc\.//')
+    elif echo "$line" \
+	    | grep -q "SUSE LLC\."; then
+	suse=true
+	who=suse
+	line=$(echo "$line" \
+		   | sed 's/SUSE LLC\.//')
+    else
+	echo "error: unknown copyright: $line"
+	exit 1
+    fi
+
+    line=$(echo "$line" \
+	       | sed 's/[,-]/ /g')
+    max_year=$(echo "$line" \
+		   | sed 's/ /\n/g' \
+		   | grep -v '^$' \
+		   | sort -n -r \
+		   | head -n 1)
+    min_year=$(echo "$line" \
+		   | sed 's/ /\n/g' \
+		   | grep -v '^$' \
+		   | sort -n \
+		   | head -n 1)
+
+    if $fsf; then
+	fsf_max=$(max "$fsf_max" "$max_year")
+	fsf_min=$(min "$fsf_min" "$min_year")
+    elif $rh; then
+	rh_max=$(max "$rh_max" "$max_year")
+	rh_min=$(min "$rh_min" "$min_year")
+    elif $suse; then
+	suse_max=$(max "$suse_max" "$max_year")
+	suse_min=$(min "$suse_min" "$min_year")
+    fi
+}
+
+main ()
+{
+    if ! git status --ignored 2>&1 \
+	   | grep -q "nothing to commit, working tree clean"; then
+	echo "Git tree not clean"
+	exit 1
+    fi
+
+    local tmp
+    tmp=$(mktemp)
+
+    for f in *.c *.h *.def; do
+	if ! grep -q "Copyright (C)" $f; then
+	    echo "error: found file without copyright marker: $f"
+	    exit 1
+	fi
+
+	echo processing file: $f
+
+	grep -v '"' $f \
+	    | awk -f contrib/copyright-lines.awk \
+		  > $tmp
+
+	while read line; do
+	    line=$(echo "$line" \
+		       | sed 's/  */ /g')
+	    line=$(echo "$line" \
+		       | sed 's/.*Copyright (C) *//')
+	    echo "Processing line: $line"
+	    process_line "$line"
+	done < $tmp
+    done
+
+    rm -f $tmp
+
+    echo "-DFSF_YEARS='\"$(print_range $fsf_min $fsf_max)\"'" \
+	 > COPYRIGHT_YEARS
+    echo "-DRH_YEARS='\"$(print_range $rh_min $rh_max)\"'" \
+	 >> COPYRIGHT_YEARS
+    echo "-DSUSE_YEARS='\"$(print_range $suse_min $suse_max)\"'" \
+	 >> COPYRIGHT_YEARS
+}
+
+main "$@"
diff --git a/dwz.c b/dwz.c
index 266f56d..727314f 100644
--- a/dwz.c
+++ b/dwz.c
@@ -12395,8 +12395,9 @@ version (void)
 {
   fprintf (stderr,
 	   "dwz version " DWZ_VERSION "\n"
-	   "Copyright (C) 2001-2012 Red Hat, Inc.\n"
-	   "Copyright (C) 2003 Free Software Foundation, Inc.\n"
+	   "Copyright (C) " RH_YEARS " Red Hat, Inc.\n"
+	   "Copyright (C) " FSF_YEARS " Free Software Foundation, Inc.\n"
+	   "Copyright (C) " SUSE_YEARS " SUSE LLC.\n"
 	   "This program is free software; you may redistribute it under the terms of\n"
 	   "the GNU General Public License version 3 or (at your option) any later version.\n"
 	   "This program has absolutely no warranty.\n");

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Branch creation: dwz-0.13-branch
  2019-01-01  0:00     ` [committed] Update --version copyright message Tom de Vries
@ 2019-01-01  0:00       ` Tom de Vries
  0 siblings, 0 replies; 10+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: dwz, Michael Matz

[ was: Re: [committed] Update --version copyright message ]

On 16-08-19 11:58, Tom de Vries wrote:
> [ was: Re: [PATCH] Add do-release.sh ]
> 
> On 12-08-19 17:18, Tom de Vries wrote:
>> On 29-07-19 19:20, Jakub Jelinek wrote:
>>> On Mon, Jul 22, 2019 at 09:41:33AM +0200, Tom de Vries wrote:
>>>> Hi,
>>>>
>>>> this commit adds a script that:
>>>> - bumps either the minor or the major version, using options
>>>>   --major or --minor
>>>> - updates VERSION
>>>> - commits VERSION update
>>>> - tags VERSION update
>>>>
>>>> OK for trunk?
>>>>
>>>> Is there anything else involved in doing a release?
>>>
>>> I think that is all, bumping VERSION, commiting and tagging was all I did in
>>> the past.
>>>
>>> One thing that might be worth doing is bump copyright years on files you've
>>> modified, I know dwz.c has been using mostly Red Hat copyright, if you want
>>> to use say FSF copyright, can you change that 2003 in there to 2003, 2019?
>>> Or do you want to use SUSE copyright instead?
>>> I guess because I have touched dwz.c last year the RH copyright should be
>>> -2018 instead of -2015 too, and dwarf2.def should be probably changed to
>>> 1992-2018 FSF copyright, using the simple range.  After the release we
>>> should likely import new dwarf2.def and dwarf2.h from GCC tree.
>>
>> Hmm, something I overlooked:
>> ...
>> $ ./dwz --version
>> dwz version 0.13
>> Copyright (C) 2001-2012 Red Hat, Inc.
>> Copyright (C) 2003 Free Software Foundation, Inc.
>> ...
>>
>> We've updated the copyright in the file headers, but not in the version
>> message.
>>
>> Patch below fixes this, updating the message using the copyright from
>> the dwz.c file header.
>>
>> I wonder though, what about the copyright in the other files:
>> dwarf2.def, dwarf2.h, dwarfnames.c, hashtab.c, hashtab.h, sha1.c and
>> sha1.h? Should we take the copyright in those files into account as
>> well? Or is it just dwz.c that matters?
> 
> I've written a script that:
> - extracts copyright lines from the source files,
> - merges them, and
> - writes out define flags to a new file COPYRIGHT_YEARS.
> 
> The version message now uses those defines.

Unfortunately, due to the master commit "Copy dwarf2.def, dwarf2.h and
dwarfnames.c from gcc", the master commit fixing the --version message
cannot be backported verbatim to 0.13 , but requires a rerun of
gen-copyright-years.sh.

It makes sense to have a dwz-0.13 branch to record this backport, which
can then be used verbatim in the various packages.

So, I've created a branch dwz-0.13-branch based on tag dwz-0.13.

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Add do-release.sh
  2019-01-01  0:00   ` Tom de Vries
@ 2019-01-01  0:00     ` Jakub Jelinek
  2019-01-01  0:00       ` Tom de Vries
  2019-01-01  0:00     ` Michael Matz
  1 sibling, 1 reply; 10+ messages in thread
From: Jakub Jelinek @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Tom de Vries; +Cc: dwz, Michael Matz

On Thu, Aug 01, 2019 at 05:13:21PM +0200, Tom de Vries wrote:
> --- a/dwarf2.def
> +++ b/dwarf2.def
> @@ -1,8 +1,7 @@
>  /* -*- c -*-
>     Declarations and definitions of codes relating to the DWARF2 and
>     DWARF3 symbolic debugging information formats.
> -   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
> -   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
> +   Copyright (C) 1992-2018
>     Free Software Foundation, Inc.

I'd remove the line break, with the year range it fits well on one line.

> --- a/dwz.c
> +++ b/dwz.c
> @@ -1,5 +1,6 @@
> -/* Copyright (C) 2001-2015 Red Hat, Inc.
> +/* Copyright (C) 2001-2018 Red Hat, Inc.
>     Copyright (C) 2003 Free Software Foundation, Inc.
> +   Copyright (C) 2019 SUSE LLC.
>     Written by Jakub Jelinek <jakub@redhat.com>, 2012.
>  
>     This program is free software; you can redistribute it and/or modify
> diff --git a/hashtab.c b/hashtab.c
> index a1da33e..59600c0 100644
> --- a/hashtab.c
> +++ b/hashtab.c
> @@ -1,5 +1,5 @@
>  /* An expandable hash tables datatype.
> -   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010
> +   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2016
>     Free Software Foundation, Inc.

And here I'd again use a range and one line.

>     Contributed by Vladimir Makarov (vmakarov@cygnus.com).

LGTM otherwise.

	Jakub

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-08-16 11:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [PATCH] Add do-release.sh Tom de Vries
2019-01-01  0:00 ` Jakub Jelinek
2019-01-01  0:00   ` Tom de Vries
2019-01-01  0:00     ` Jakub Jelinek
2019-01-01  0:00       ` Tom de Vries
2019-01-01  0:00     ` Michael Matz
2019-01-01  0:00   ` [committed] Copy dwarf2.def, dwarf2.h and dwarfnames.c from gcc Tom de Vries
2019-01-01  0:00   ` [PATCH] Add do-release.sh Tom de Vries
2019-01-01  0:00     ` [committed] Update --version copyright message Tom de Vries
2019-01-01  0:00       ` Branch creation: dwz-0.13-branch Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).