@@ -381,6 +381,8 @@ def configure_options(target):
381381 # user-specified options to apply to all targets
382382 options += args .config_options
383383
384+ disable_spm = False
385+
384386 for config in options :
385387 if config .endswith (".h" ):
386388 # a config file - overwrite existing config file
@@ -390,8 +392,11 @@ def configure_options(target):
390392 else :
391393 dest = CONFIG_FILE
392394 if config in { TFM_CONFIG , TFM_CRYPTO_CONFIG } and not os .path .exists (path ):
393- # for looking at old checkouts where these configs were not in the tree, fetch from HEAD instead
394- log (f"git show origin/development:configs/{ config } > { dest [len (ROOT ) + 1 :]} " )
395+ # for looking at old checkouts where these configs were not in the tree, fetch from
396+ # date they were first created instead
397+ # also disable MBEDTLS_PSA_CRYPTO_SPM is required to get it to build
398+ disable_spm = True
399+ log (f"git show 2f1ae5a86ebd67faa50c3983b4567656c2234674:configs/{ config } > { dest [len (ROOT ) + 1 :]} " )
395400 output , _ = subrun (["git" , "show" , "origin/development:configs/" + config ], silent = True )
396401 with open (dest , 'w' ) as f :
397402 f .write (output )
@@ -410,6 +415,10 @@ def configure_options(target):
410415 log (f"scripts/config.py { config } " )
411416 subrun ([f"{ ROOT } /scripts/config.py" , config ], silent = True )
412417
418+ if disable_spm :
419+ # at some point in the past, MBEDTLS_HAVE_ASM also needs disabling,
420+ # and more options again (not sure which) for 3.0.0
421+ set_config_option ("unset" , "MBEDTLS_PSA_CRYPTO_SPM" , silent = False )
413422
414423def flags_to_hr_str (flags ):
415424 hrs = ""
0 commit comments