changes needed to successfully build gcc (#83)

* clang doesn't have `-nodefaultrpaths`
* try `MachO::FatFile` if `MachO:MachOFile` fails
* add explicit comments
* use `MachO.open()`
* fix fetch.ts for no src pkgs

Co-authored-by: Max Howell <mxcl@me.com>
This commit is contained in:
Jacob Heider 2023-01-03 08:45:57 -05:00 committed by GitHub
parent c78878a22f
commit fc31bb8939
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 5 deletions

View file

@ -11,8 +11,9 @@ $tea_prefix = ENV['TEA_PREFIX'] || `tea --prefix`.chomp
exe = File.basename($0) exe = File.basename($0)
# remove duplicates since this in fact embeds the rpath multiple times # remove duplicates since this in fact embeds the rpath multiple times
# and omit -nodefaultrpaths since it is not a valid flag for clang
args = ARGV.map do |arg| args = ARGV.map do |arg|
arg unless arg == "-Wl,-rpath,#$tea_prefix" arg unless arg == "-Wl,-rpath,#$tea_prefix" or arg == "-nodefaultrpaths"
end.compact end.compact
# find next example of ourselves # find next example of ourselves

View file

@ -3,7 +3,7 @@ distributable: ~
# FIXME we want the c version eg. c99 # FIXME we want the c version eg. c99
# or should that be some kind of option? so you specify you want a cc that support c99 # or should that be some kind of option? so you specify you want a cc that support c99
versions: versions:
- 0.1.1 - 0.1.2
dependencies: dependencies:
linux: linux:

View file

@ -41,7 +41,7 @@ end
class Fixer class Fixer
def initialize(file) def initialize(file)
@file = MachO::MachOFile.new(file) @file = MachO.open(file)
@changed = false @changed = false
end end

View file

@ -53,7 +53,12 @@ export async function fetch_src(pkg: Package): Promise<[Path, Path] | undefined>
if (import.meta.main) { if (import.meta.main) {
for await (let pkg of ARGV.pkgs()) { for await (let pkg of ARGV.pkgs()) {
pkg = await pantry.resolve(pkg) pkg = await pantry.resolve(pkg)
const rv = await fetch_src(pkg) ?? panic() const rv = await fetch_src(pkg)
await print(rv.join("\n") + "\n") if (rv) {
// a package doesnt require a source tarball
//FIXME is this dumb tho? In theory a package could just be a build script that generates itself
// in practice this is rare and pkgs could just specify some dummy tarball
await print(rv.join("\n") + "\n")
}
} }
} }