* lisp/emacs-lisp/advice.el (ad-add-advice): Do not try to
install trampolines in vanilla builds.
If FUNCTION was not advised already, its advice info will be
initialized. Redefining a piece of advice whose name is part of
the cache-id will clear the cache."
- (when (subr-primitive-p (symbol-function function))
+ (when (and (featurep 'nativecomp)
+ (subr-primitive-p (symbol-function function)))
(comp-subr-trampoline-install function))
(cond ((not (ad-is-advised function))
(ad-initialize-advice-info function)