Skip to content

Commit

Permalink
Fix embedded-runtimes and newlib for arm-elf
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien-Chouteau committed May 24, 2024
1 parent 868e850 commit f671096
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion specs/embedded-runtimes.anod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class EmbeddedRuntimes(spec("common")):

@property
def commit_id(self):
return "0d5e0999c7bf5e8f29aeb69b9cb3d0b687c6d373"
return "4386b1dcd0e995ac9b9e1b221cf386238d3c1537"

@property
def tarball(self):
Expand Down
25 changes: 22 additions & 3 deletions specs/newlib.anod
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
from e3.os.fs import unixpath
from e3.os.fs import unixpath, touch
from e3.anod.helper import Configure, Make
from e3.anod.spec import Anod
from e3.anod.loader import spec
from e3.diff import patch
from e3.fs import cp
import os


patch_name = "newlib-fix-arm-eh_frame.patch"

class Newlib(spec("common")):
@property
def version(self):
Expand All @@ -19,12 +24,15 @@ class Newlib(spec("common")):
self.HTTPSSourceBuilder(
name=self.tarball,
url="https://sourceware.org/pub/newlib/" + self.tarball,
)
),
self.LocalSourceBuilder(name=patch_name),
]

@property
def build_source_list(self):
return [Anod.Source(name=self.tarball, publish=True, dest="")]
return [Anod.Source(name=self.tarball, publish=True, dest=""),
self.Source(name=patch_name, publish=True, unpack_cmd=cp, dest="patches"),
]

@property
def build_deps(self):
Expand All @@ -45,6 +53,17 @@ class Newlib(spec("common")):
def build(self):
self.deps["gcc"].setenv()

# Little hack to apply the patch only once, there is probably a clean
# way to do that.
patched = os.path.join(self["SRC_DIR"], "patches", ".patched")
if not os.path.exists(patched):
patch(
os.path.join(self["SRC_DIR"], "patches", patch_name),
self.build_space.src_dir,
)
touch(patched)


configure = Configure(self)
configure.add("--prefix=%s" % unixpath(self["INSTALL_DIR"]))

Expand Down

0 comments on commit f671096

Please sign in to comment.