MCPcopy Create free account
hub / github.com/ClangBuiltLinux/tc-build / PowerPCKernelBuilder

Class PowerPCKernelBuilder

tc_build/kernel.py:271–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269
270
271class PowerPCKernelBuilder(KernelBuilder):
272 def __init__(self) -> None:
273 super().__init__('powerpc')
274
275 self.use_ias = False
276
277 self.possible_cross_compile_vals: tuple[str, str, str] = (
278 'powerpc-linux-gnu-',
279 'powerpc64-linux-gnu-',
280 'powerpc64le-linux-gnu-',
281 )
282
283 def find_cross_compile(self) -> None:
284 if self.cross_compile: # already run
285 return
286
287 # Most powerpc binutils support both types of endianness and word
288 # sizes. Look for whatever one is available.
289 for cross_compile in self.possible_cross_compile_vals:
290 if shutil.which(f"{cross_compile}elfedit"):
291 self.cross_compile = cross_compile
292 return
293
294 # No binutils found. Set cross compile to the first value in the tuple,
295 # as that will be the "most compatible" one to report back to the user.
296 self.cross_compile = self.possible_cross_compile_vals[0]
297
298 def build(self) -> None:
299 self.find_cross_compile()
300
301 super().build()
302
303
304class PowerPC32KernelBuilder(PowerPCKernelBuilder):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected