- (if (gethash stem stems)
- (error "duplicate stem ~S in *STEMS-AND-FLAGS*" stem)
- (setf (gethash stem stems) t))
+ ;; We do duplicate stem comparison based on the object path in
+ ;; order to cover the case of stems with an :assem flag, which
+ ;; have two entries but separate object paths for each. KLUDGE:
+ ;; We have to bind *target-obj-prefix* here because it's normally
+ ;; set up later in the build process and we don't actually care
+ ;; what it is so long as it doesn't change while we're checking
+ ;; for duplicate stems.
+ (let* ((*target-obj-prefix* "")
+ (object-path (stem-object-path stem flags :target-compile)))
+ (if (gethash object-path stems)
+ (error "duplicate stem ~S in *STEMS-AND-FLAGS*" stem)
+ (setf (gethash object-path stems) t)))
+ ;; FIXME: We should make sure that the :assem flag is only used
+ ;; when paired with :not-host.