andrzej-kaczmarek commented on code in PR #540:
URL: https://github.com/apache/mynewt-newt/pull/540#discussion_r1472798914


##########
newt/pkg/bsp_package.go:
##########
@@ -103,14 +113,33 @@ func (bsp *BspPackage) resolveLinkerScriptSetting(
                        return nil, err
                }
 
-               if path != "" {
+               if path == "autogenerated" {
+                       path, err = bsp.getAutogeneratedLinkerScriptPath()
+                       if err != nil {
+                               return nil, util.PreNewtError(err,
+                                       "Could not resolve autogenerated linker 
script path for target \"%s\"",
+                                       bsp.yov.Pkg.Name())
+                       }
+                       paths = append(paths, path)
+               } else if path != "" {
                        paths = append(paths, path)
                }
        } else {
                proj := interfaces.GetProject()
 
                // Read each linker script from the list.
                for _, val := range vals {
+                       if val == "autogenerated" {
+                               path, err := 
bsp.getAutogeneratedLinkerScriptPath()
+                               if err != nil {
+                                       return nil, util.PreNewtError(err,
+                                               "Could not resolve 
autogenerated linker script path for target \"%s\"",
+                                               bsp.yov.Pkg.Name())
+                               }
+                               paths = append(paths, path)
+                               continue
+                       }

Review Comment:
   autogenerated scripts should be only handled if single script is set to 
"autogenerated", here it should better just return an error



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to