diff --git a/bin/bitbake-layers b/bin/bitbake-layers
index 341ecbcd9..c4569c6c3 100755
--- a/bin/bitbake-layers
+++ b/bin/bitbake-layers
@@ -64,6 +64,9 @@ def main():
         if global_args.force > 1:
             bbpaths = []
         else:
+            if toolname == "bitbake-config-build":
+                os.environ["BB_ENV_PASSTHROUGH_ADDITIONS"] = os.getenv("BB_ENV_PASSTHROUGH_ADDITIONS") + " _BB_INTERNAL_RUN_BITBAKE_CONFIG_BUILD_"
+                os.environ["_BB_INTERNAL_RUN_BITBAKE_CONFIG_BUILD_"] = "1"
             tinfoil.prepare(True)
             bbpaths = tinfoil.config_data.getVar('BBPATH').split(':')
 
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index e6ff1ff76..70a2a37a6 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -364,6 +364,13 @@ class AddFragmentsNode(AstNode):
         def check_and_set_builtin_fragment(fragment, data, builtin_fragments):
             prefix, value = fragment.split('/', 1)
             if prefix in builtin_fragments.keys():
+                if data.getVar(builtin_fragments[prefix], noweakdefault=True) != None:
+                    if not os.getenv("_BB_INTERNAL_RUN_BITBAKE_CONFIG_BUILD_"):
+                        bb.fatal(
+                            ("A builtin fragment '%s' is used while %s has already got an assignment.\n"
+                             "Please either disable the fragment or remove the value assignment.\n"
+                             "To disable the fragment, use 'bitbake-config-build disable-fragment %s'."
+                             ) % (fragment, builtin_fragments[prefix], fragment))
                 fragment_history = data.varhistory.variable(self.fragments_variable)
                 loginfo={}
                 for fh in fragment_history[::-1]:
