[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RFC] Removing support for GCJ and GCJFLAGS from dpkg?



Hi!

On Wed, 2023-08-30 at 20:35:40 -0700, tony mancill wrote:
> No concerns from the Debian Java team.  I can't imagine any breakage,
> but if there is any fall-out, it would be due to cruft that we should
> clean up anyway.  The dependency on gcj-jdk was dropped from javahelper
> (src:javatools) for buster [0].

> [0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892530

On Thu, 2023-08-31 at 19:19:50 +0200, Emmanuel Bourg wrote:
> Yes go ahead, GCJ is long dead and gone, you can remove the remaining
> references safely.

Thanks both for the confirmation! I've queued the attached patch which
will be included in my next git push targeting dpkg 1.22.1.

Regards,
Guillem
From 444a0d7b0546cde45c752f12125810cfeb5bf667 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Thu, 31 Aug 2023 20:00:46 +0200
Subject: [PATCH] scripts: Remove unused GCJ and GCJFLAGS support

The gcj project is dead since 2018.
---
 doc/README.feature-removal-schedule |  6 ++++++
 man/dpkg-buildflags.pod             | 22 +++++++++-------------
 scripts/Dpkg/BuildFlags.pm          |  3 ---
 scripts/Dpkg/BuildInfo.pm           |  1 -
 scripts/Dpkg/Vendor/Debian.pm       |  1 -
 scripts/mk/buildflags.mk            |  3 +--
 scripts/mk/buildtools.mk            |  2 --
 scripts/t/Dpkg_BuildFlags_Ubuntu.t  |  4 ++--
 scripts/t/Dpkg_BuildInfo.t          |  2 +-
 scripts/t/mk.t                      |  1 -
 scripts/t/mk/buildflags.mk          |  1 -
 scripts/t/mk/buildtools.mk          |  2 --
 12 files changed, 19 insertions(+), 29 deletions(-)

diff --git a/doc/README.feature-removal-schedule b/doc/README.feature-removal-schedule
index 928880f0a..f9b1f0b53 100644
--- a/doc/README.feature-removal-schedule
+++ b/doc/README.feature-removal-schedule
@@ -172,3 +172,9 @@ Warning: program
 Why:
  Obsoleted long time ago (2005-01-22). Remaining packages should switch to
  use 'dpkg --print-architecture'.
+
+What: GCJ and GCJFLAGS support
+Status: removed
+When: 1.22.1
+Why:
+ GCJ has been dead upstream since 2018.
diff --git a/man/dpkg-buildflags.pod b/man/dpkg-buildflags.pod
index 95587ceaa..2c382cdfc 100644
--- a/man/dpkg-buildflags.pod
+++ b/man/dpkg-buildflags.pod
@@ -286,10 +286,6 @@ Since dpkg 1.17.7.
 Options for the Objective C++ compiler. Same as B<CXXFLAGS>.
 Since dpkg 1.17.7.
 
-=item B<GCJFLAGS>
-
-Options for the GNU Java compiler (gcj). A subset of B<CFLAGS>.
-
 =item B<DFLAGS>
 
 Options for the D compiler (ldc or gdc). Since dpkg 1.20.6.
@@ -420,7 +416,7 @@ artifacts.
 
 This setting (since dpkg 1.21.0; disabled by default) enables
 Link Time Optimization by adding B<-flto=auto -ffat-lto-objects> to
-B<CFLAGS>, B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>, B<GCJFLAGS>,
+B<CFLAGS>, B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
 B<FFLAGS>, B<FCFLAGS> and B<LDFLAGS>.
 
 =back
@@ -511,7 +507,7 @@ glibc 2.16 and later.
 This setting (since dpkg 1.16.1; enabled by default if stackprotectorstrong
 is not in use) adds B<-fstack-protector --param=ssp-buffer-size=4>
 to B<CFLAGS>, B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
-B<GCJFLAGS>, B<FFLAGS> and B<FCFLAGS>.
+B<FFLAGS> and B<FCFLAGS>.
 This adds safety checks against stack
 overwrites. This renders many potential code injection attacks into
 aborting situations. In the best case this turns code injection
@@ -527,7 +523,7 @@ B<-nostdlib> or B<-ffreestanding> or similar.
 This setting (since dpkg 1.17.11; enabled by default) adds
 B<-fstack-protector-strong>
 to B<CFLAGS>, B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
-B<GCJFLAGS>, B<FFLAGS> and B<FCFLAGS>.
+B<FFLAGS> and B<FCFLAGS>.
 This is a stronger variant of B<stackprotector>, but without significant
 performance penalties.
 
@@ -541,7 +537,7 @@ addition also requires gcc 4.9 and later.
 This setting (since dpkg 1.22.0; enabled by default) adds
 B<-fstack-clash-protection> on B<amd64>, B<arm64>, B<armhf> and B<armel> to
 B<CFLAGS>, B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
-B<GCJFLAGS>, B<FFLAGS> and B<FCFLAGS>.
+B<FFLAGS> and B<FCFLAGS>.
 This adds code to prevent stack clash style attacks.
 
 =item B<branch>
@@ -549,7 +545,7 @@ This adds code to prevent stack clash style attacks.
 This setting (since dpkg 1.22.0; enabled by default) adds B<-fcf-protection>
 on B<amd64> and B<-mbranch-protection=standard> on B<arm64> to
 B<CFLAGS>, B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
-B<GCJFLAGS>, B<FFLAGS> and B<FCFLAGS>.
+B<FFLAGS> and B<FCFLAGS>.
 This adds branch protection to indirect calls, jumps and returns to check
 whether these are valid at run-time.
 
@@ -584,12 +580,12 @@ by itself or not.
 When the setting is enabled and gcc injects the flags, it adds nothing.
 When the setting is enabled and gcc does not inject the flags, it adds
 B<-fPIE> (via I<%PKGDATADIR%/pie-compiler.specs>) to B<CFLAGS>,
-B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>, B<GCJFLAGS>,
+B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
 B<FFLAGS> and B<FCFLAGS>, and
 B<-fPIE -pie> (via I<%PKGDATADIR%/pie-link.specs>) to B<LDFLAGS>.
 When the setting is disabled and gcc injects the flags, it adds
 B<-fno-PIE> (via I<%PKGDATADIR%/no-pie-compile.specs>) to B<CFLAGS>,
-B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>, B<GCJFLAGS>,
+B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
 B<FFLAGS> and B<FCFLAGS>, and
 B<-fno-PIE -no-pie> (via I<%PKGDATADIR%/no-pie-link.specs>) to
 B<LDFLAGS>.
@@ -673,7 +669,7 @@ B<__TIMESTAMP__> macros are used.
 This setting (since dpkg 1.19.1; enabled by default) adds
 B<-ffile-prefix-map=>I<BUILDPATH>B<=.>
 to B<CFLAGS>, B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
-B<GCJFLAGS>, B<FFLAGS> and B<FCFLAGS> where B<BUILDPATH> is
+B<FFLAGS> and B<FCFLAGS> where B<BUILDPATH> is
 set to the top-level directory of the package being built.
 This has the effect of removing the build path from any generated file.
 
@@ -692,7 +688,7 @@ The ideal fix is to stop capturing build flags.
 This setting (since dpkg 1.18.5; enabled by default) adds
 B<-fdebug-prefix-map=>I<BUILDPATH>B<=.>
 to B<CFLAGS>, B<CXXFLAGS>, B<OBJCFLAGS>, B<OBJCXXFLAGS>,
-B<GCJFLAGS>, B<FFLAGS> and B<FCFLAGS> where B<BUILDPATH> is
+B<FFLAGS> and B<FCFLAGS> where B<BUILDPATH> is
 set to the top-level directory of the package being built.
 This has the effect of removing the build path from any generated debug
 symbols.
diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm
index 3e7dfdef9..ff5b3eb0e 100644
--- a/scripts/Dpkg/BuildFlags.pm
+++ b/scripts/Dpkg/BuildFlags.pm
@@ -83,7 +83,6 @@ sub _init_vendor_defaults {
 	CXXFLAGS => '',
 	OBJCFLAGS   => '',
 	OBJCXXFLAGS => '',
-	GCJFLAGS => '',
 	DFLAGS   => '',
 	FFLAGS   => '',
 	FCFLAGS  => '',
@@ -96,7 +95,6 @@ sub _init_vendor_defaults {
 	CXXFLAGS => 'vendor',
 	OBJCFLAGS   => 'vendor',
 	OBJCXXFLAGS => 'vendor',
-	GCJFLAGS => 'vendor',
 	DFLAGS   => 'vendor',
 	FFLAGS   => 'vendor',
 	FCFLAGS  => 'vendor',
@@ -109,7 +107,6 @@ sub _init_vendor_defaults {
 	CXXFLAGS => 0,
 	OBJCFLAGS   => 0,
 	OBJCXXFLAGS => 0,
-	GCJFLAGS => 0,
 	DFLAGS   => 0,
 	FFLAGS   => 0,
 	FCFLAGS  => 0,
diff --git a/scripts/Dpkg/BuildInfo.pm b/scripts/Dpkg/BuildInfo.pm
index 475dc4488..761c16658 100644
--- a/scripts/Dpkg/BuildInfo.pm
+++ b/scripts/Dpkg/BuildInfo.pm
@@ -76,7 +76,6 @@ my @env_allowed = (
         CXXFLAGS
         OBJCFLAGS
         OBJCXXFLAGS
-        GCJFLAGS
         DFLAGS
         FFLAGS
         LDFLAGS
diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 1cc2393d6..1794ccbef 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -397,7 +397,6 @@ sub _add_build_flags {
         OBJCXXFLAGS
         FFLAGS
         FCFLAGS
-        GCJFLAGS
     );
 
     my $default_flags;
diff --git a/scripts/mk/buildflags.mk b/scripts/mk/buildflags.mk
index 9cef0c0c4..c264c57c3 100644
--- a/scripts/mk/buildflags.mk
+++ b/scripts/mk/buildflags.mk
@@ -6,7 +6,6 @@
 #   CXXFLAGS: flags for the C++ compiler.
 #   OBJCFLAGS: flags for the Objective C compiler.
 #   OBJCXXFLAGS: flags for the Objective C++ compiler.
-#   GCJFLAGS: flags for the GNU Java compiler.
 #   DFLAGS: flags for the D compiler.
 #   FFLAGS: flags for the Fortran 77 compiler.
 #   FCFLAGS: flags for the Fortran 9x compiler.
@@ -21,7 +20,7 @@
 dpkg_lazy_eval ?= $$(or $$(value DPKG_CACHE_$(1)),$$(eval DPKG_CACHE_$(1) := $$(shell $(2)))$$(value DPKG_CACHE_$(1)))
 
 DPKG_BUILDFLAGS_LIST = ASFLAGS CFLAGS CPPFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS \
-                       GCJFLAGS DFLAGS FFLAGS FCFLAGS LDFLAGS
+                       DFLAGS FFLAGS FCFLAGS LDFLAGS
 
 define dpkg_buildflags_export_envvar
   ifdef $(1)
diff --git a/scripts/mk/buildtools.mk b/scripts/mk/buildtools.mk
index 8e3beb0dc..933fdcfaa 100644
--- a/scripts/mk/buildtools.mk
+++ b/scripts/mk/buildtools.mk
@@ -7,7 +7,6 @@
 #   CXX: C++ compiler.
 #   OBJC: Objective C compiler.
 #   OBJCXX: Objective C++ compiler.
-#   GCJ: GNU Java compiler.
 #   F77: Fortran 77 compiler.
 #   FC: Fortran 9x compiler.
 #   LD: linker.
@@ -64,7 +63,6 @@ $(eval $(call dpkg_buildtool_setvar,CC,gcc))
 $(eval $(call dpkg_buildtool_setvar,CXX,g++))
 $(eval $(call dpkg_buildtool_setvar,OBJC,gcc))
 $(eval $(call dpkg_buildtool_setvar,OBJCXX,g++))
-$(eval $(call dpkg_buildtool_setvar,GCJ,gcj))
 $(eval $(call dpkg_buildtool_setvar,F77,gfortran))
 $(eval $(call dpkg_buildtool_setvar,FC,gfortran))
 $(eval $(call dpkg_buildtool_setvar,LD,ld))
diff --git a/scripts/t/Dpkg_BuildFlags_Ubuntu.t b/scripts/t/Dpkg_BuildFlags_Ubuntu.t
index 53cd1e8f3..822fbf6f7 100644
--- a/scripts/t/Dpkg_BuildFlags_Ubuntu.t
+++ b/scripts/t/Dpkg_BuildFlags_Ubuntu.t
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 21;
+use Test::More tests => 19;
 
 BEGIN {
     use_ok('Dpkg::BuildFlags');
@@ -26,7 +26,7 @@ sub test_optflag
 {
     my ($bf, $optflag) = @_;
 
-    foreach my $flag (qw(CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS GCJFLAGS
+    foreach my $flag (qw(CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS
                          FFLAGS FCFLAGS)) {
         my $value = $bf->get($flag);
         ok($value =~ m/$optflag/, "$flag contains $optflag: $value");
diff --git a/scripts/t/Dpkg_BuildInfo.t b/scripts/t/Dpkg_BuildInfo.t
index 712911cbc..2dad01d7f 100644
--- a/scripts/t/Dpkg_BuildInfo.t
+++ b/scripts/t/Dpkg_BuildInfo.t
@@ -22,5 +22,5 @@ BEGIN {
     use_ok('Dpkg::BuildInfo');
 }
 
-is(scalar Dpkg::BuildInfo::get_build_env_allowed(), 52,
+is(scalar Dpkg::BuildInfo::get_build_env_allowed(), 51,
    'allowed environment variables array');
diff --git a/scripts/t/mk.t b/scripts/t/mk.t
index abf1a75bb..a31eef72e 100644
--- a/scripts/t/mk.t
+++ b/scripts/t/mk.t
@@ -107,7 +107,6 @@ my %buildtools = (
     CXX => 'g++',
     OBJC => 'gcc',
     OBJCXX => 'g++',
-    GCJ => 'gcj',
     F77 => 'gfortran',
     FC => 'gfortran',
     LD => 'ld',
diff --git a/scripts/t/mk/buildflags.mk b/scripts/t/mk/buildflags.mk
index 542bced43..c5d0abb46 100644
--- a/scripts/t/mk/buildflags.mk
+++ b/scripts/t/mk/buildflags.mk
@@ -10,7 +10,6 @@ test:
 	test "$(DFLAGS)" = "$(TEST_DFLAGS)"
 	test "$(FCFLAGS)" = "$(TEST_FCFLAGS)"
 	test "$(FFLAGS)" = "$(TEST_FFLAGS)"
-	test "$(GCJFLAGS)" = "$(TEST_GCJFLAGS)"
 	test "$(LDFLAGS)" = "$(TEST_LDFLAGS)"
 	test "$(OBJCFLAGS)" = "$(TEST_OBJCFLAGS)"
 	test "$(OBJCXXFLAGS)" = "$(TEST_OBJCXXFLAGS)"
diff --git a/scripts/t/mk/buildtools.mk b/scripts/t/mk/buildtools.mk
index 0077791b5..6c27c5cf2 100644
--- a/scripts/t/mk/buildtools.mk
+++ b/scripts/t/mk/buildtools.mk
@@ -11,8 +11,6 @@ test:
 	test "$(OBJC_FOR_BUILD)" = "$(TEST_OBJC_FOR_BUILD)"
 	test "$(OBJCXX)" = "$(TEST_OBJCXX)"
 	test "$(OBJCXX_FOR_BUILD)" = "$(TEST_OBJCXX_FOR_BUILD)"
-	test "$(GCJ)" = "$(TEST_GCJ)"
-	test "$(GCJ_FOR_BUILD)" = "$(TEST_GCJ_FOR_BUILD)"
 	test "$(F77)" = "$(TEST_F77)"
 	test "$(F77_FOR_BUILD)" = "$(TEST_F77_FOR_BUILD)"
 	test "$(FC)" = "$(TEST_FC)"
-- 
2.40.1


Reply to: