Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92474e5b authored by Yi Kong's avatar Yi Kong
Browse files

Add "-no-warn-sample-unuse=true" to work around AutoFDO issue

Autofdo generates profile for an instruction even if there is no debug
information associated with it or no debug information associated with
the function. A bogus offset will be produced in the profile. Add the
flag to suppress Clang from generating error for such cases.

Test: build with ETM profile
Bug: 147844018
Bug: 79161490
Change-Id: I37da1ba3a4962072ccdf01f79fbf2c2b4c77b56b
parent a7503367
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -177,6 +177,10 @@ func (props *PgoProperties) addProfileUseFlags(ctx ModuleContext, flags Flags) F
		// if profileFile gets updated
		flags.CFlagsDeps = append(flags.CFlagsDeps, profileFilePath)
		flags.LdFlagsDeps = append(flags.LdFlagsDeps, profileFilePath)

		if props.isSampling() {
			flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,-mllvm,-no-warn-sample-unused=true")
		}
	}
	return flags
}