41d3ee0
From e7ff390ef777bd818ccc6e6f8f3a56f36020abfe Mon Sep 17 00:00:00 2001
41d3ee0
From: Mat Booth <mat.booth@gmail.com>
41d3ee0
Date: Wed, 15 Sep 2021 10:21:53 +0100
41d3ee0
Subject: [PATCH 1/2] Always generate bytecode debuginfo
41d3ee0
41d3ee0
When ecj is used to build RPMs
41d3ee0
---
41d3ee0
 .../jdt/internal/compiler/batch/Main.java     | 23 +++++++++++++++++++
41d3ee0
 1 file changed, 23 insertions(+)
41d3ee0
41d3ee0
diff --git a/org/eclipse/jdt/internal/compiler/batch/Main.java b/org/eclipse/jdt/internal/compiler/batch/Main.java
41d3ee0
index f77372d..73a0d24 100644
41d3ee0
--- a/org/eclipse/jdt/internal/compiler/batch/Main.java
41d3ee0
+++ b/org/eclipse/jdt/internal/compiler/batch/Main.java
41d3ee0
@@ -3109,6 +3109,29 @@ public void configure(String[] argv) {
79be5b8
 		this.options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
79be5b8
 	}
79be5b8
 
79be5b8
+	{
79be5b8
+		// If we're building an RPM, force full debugging info to
79be5b8
+		// be generated, no matter what options have been passed
79be5b8
+		// by Ant.  This is something of a kludge, but it is far
79be5b8
+		// better than the alternative, which is having class
79be5b8
+		// files with debug info mysteriously missing.
79be5b8
+
79be5b8
+		String RpmPackageName = System.getenv("RPM_PACKAGE_NAME");
79be5b8
+		String RpmArch = System.getenv("RPM_ARCH");
79be5b8
+		String RpmBuildRoot = System.getenv("RPM_BUILD_ROOT");
79be5b8
+		if (RpmPackageName != null && RpmArch != null && RpmBuildRoot != null) {
79be5b8
+			this.options.put(
79be5b8
+					CompilerOptions.OPTION_LocalVariableAttribute,
79be5b8
+					CompilerOptions.GENERATE);
79be5b8
+			this.options.put(
79be5b8
+					CompilerOptions.OPTION_LineNumberAttribute,
79be5b8
+					CompilerOptions.GENERATE);
79be5b8
+			this.options.put(
79be5b8
+					CompilerOptions.OPTION_SourceFileAttribute,
79be5b8
+					CompilerOptions.GENERATE);
79be5b8
+		}
79be5b8
+	}
79be5b8
+
79be5b8
 	this.logger.logCommandLineArguments(newCommandLineArgs);
79be5b8
 	this.logger.logOptions(this.options);
79be5b8
 
41d3ee0
-- 
41d3ee0
2.31.1
41d3ee0