Merge remote-tracking branch 'origin/xdccore-A-sasha' into master_ggentree
diff --git a/src/packages/xdc/cfg/Main.xs b/src/packages/xdc/cfg/Main.xs
index 8a0636f..d477d31 100644
--- a/src/packages/xdc/cfg/Main.xs
+++ b/src/packages/xdc/cfg/Main.xs
@@ -1520,7 +1520,17 @@
     var unit = xdc.module(qname, cycles == undefined ? false : cycles);
 
     if (unit.$category == "Interface") {
-        if ("$used" in unit) {
+        /* Older schemas sealed '$used' for interfaces by default. We can
+         * remove the check for the build version, when either 3.31.0 packages
+         * are not supported anymore or we increment the red version number up
+         * from 170 and all older schemas are rebuilt.
+         */
+        origVers = Packages.xdc.services.global.Vers.getXdcString(
+		unit.$package.packageBase + "/package/package.defs.h");
+        if (origVers > "xdc-a00" || origVers < "xdc-A66") {
+            unit.$unseal("$used");
+        }
+       if ("$used" in unit) {
             unit.$used = true;
         }
         return (unit);