Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Shamar committed Nov 26, 2018
2 parents 98675f1 + 266d2c4 commit 85e6cab
Show file tree
Hide file tree
Showing 1,687 changed files with 52,318 additions and 24,798 deletions.
6 changes: 3 additions & 3 deletions COPYING.NEWLIB
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,9 @@ SUCH DAMAGE.
SUCH DAMAGE.


(35) - ARM Ltd (arm and thumb variant targets only)
(35) - Arm Ltd

Copyright (c) 2009-2015 ARM Ltd
Copyright (c) 2009-2018 Arm Ltd
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -1140,7 +1140,7 @@ Copyright (c) 2017 SiFive Inc. All rights reserved.

This copyrighted material is made available to anyone wishing to use,
modify, copy, or redistribute it subject to the terms and conditions
of the BSD License. This program is distributed in the hope that
of the FreeBSD License. This program is distributed in the hope that
it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
including the implied warranties of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. A copy of this license is available at
Expand Down
183 changes: 53 additions & 130 deletions Makefile.in

Large diffs are not rendered by default.

79 changes: 53 additions & 26 deletions Makefile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ DLLTOOL = @DLLTOOL@
LD = @LD@
LIPO = @LIPO@
NM = @NM@
OBJCOPY = @OBJCOPY@
OBJDUMP = @OBJDUMP@
RANLIB = @RANLIB@
READELF = @READELF@
Expand Down Expand Up @@ -1822,25 +1823,46 @@ configure-target-[+module+]: maybe-all-gcc[+
(define dep-maybe (lambda ()
(if (exist? "hard") "" "maybe-")))

;; dep-kind returns "normal" if the dependency is on an "install" target,
;; or if either module is not bootstrapped. It returns "bootstrap" for
;; configure or build dependencies between bootstrapped modules; it returns
;; "prebootstrap" for configure or build dependencies of bootstrapped
;; modules on a build module (e.g. all-gcc on all-build-bison). All this
;; is only necessary for host modules.
;; dep-kind returns returns "prebootstrap" for configure or build
;; dependencies of bootstrapped modules on a build module
;; (e.g. all-gcc on all-build-bison); "normal" if the dependency is
;; on an "install" target, or if the dependence module is not
;; bootstrapped; otherwise, it returns "bootstrap" or
;; "postbootstrap" depending on whether the dependent module is
;; bootstrapped. All this is only necessary for host and target
;; modules. It might seem like, in order to avoid build races, we
;; might need more elaborate detection between prebootstrap and
;; postbootstrap modules, but there are no host prebootstrap
;; modules. If there were any non-bootstrap host modules that
;; bootstrap modules depended on, we'd get unsatisfied per-stage
;; dependencies on them, which would be immediately noticed.
(define dep-kind (lambda ()
(if (and (hash-ref boot-modules (dep-module "module"))
(=* (dep-module "on") "build-"))
"prebootstrap"
(cond
((and (hash-ref boot-modules (dep-module "module"))
(=* (dep-module "on") "build-"))
"prebootstrap")

(if (or (= (dep-subtarget "on") "install-")
(not (hash-ref boot-modules (dep-module "module")))
(not (hash-ref boot-modules (dep-module "on"))))
"normal"
"bootstrap"))))
((or (= (dep-subtarget "on") "install-")
(not (hash-ref boot-modules (dep-module "on"))))
"normal")

((hash-ref boot-modules (dep-module "module"))
"bootstrap")

(1 "postbootstrap"))))

(define make-postboot-dep (lambda ()
(let ((target (dep-module "module")) (dep "stage_last"))
(unless (= (hash-ref postboot-targets target) dep)
(hash-create-handle! postboot-targets target dep)
;; All non-bootstrap modules' configure target already
;; depend on dep.
(unless (=* target "target-")
(string-append "configure-" target ": " dep "\n"))))))

;; We now build the hash table that is used by dep-kind.
(define boot-modules (make-hash-table 113))
(define postboot-targets (make-hash-table 113))
+]

[+ FOR host_modules +][+
Expand All @@ -1857,18 +1879,23 @@ configure-target-[+module+]: maybe-all-gcc[+
# to check for bootstrap/prebootstrap dependencies. To resolve
# prebootstrap dependencies, prebootstrap modules are gathered in
# a hash table.
[+ FOR dependencies +][+ (make-dep "" "") +]
[+ CASE (dep-kind) +]
[+ == "prebootstrap"
+][+ FOR bootstrap_stage +]
[+ (make-dep (dep-stage) "") +][+
ENDFOR bootstrap_stage +]
[+ == "bootstrap"
+][+ FOR bootstrap_stage +]
[+ (make-dep (dep-stage) (dep-stage)) +][+
ENDFOR bootstrap_stage +]
[+ ESAC +][+
ENDFOR dependencies +]
[+ FOR dependencies +][+ CASE (dep-kind) +]
[+ == "prebootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +]
[+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +]
[+ == "bootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +]
[+ (make-dep (dep-stage) (dep-stage)) +][+ ENDFOR bootstrap_stage +]
[+ == "normal" +][+ (make-dep "" "") +]
[+ ESAC +][+ ENDFOR dependencies +]

@if gcc-bootstrap
[+ FOR dependencies +][+ CASE (dep-kind) +]
[+ == "postbootstrap" +][+ (make-postboot-dep) +][+ ESAC +][+
ENDFOR dependencies +]@endif gcc-bootstrap

@unless gcc-bootstrap
[+ FOR dependencies +][+ CASE (dep-kind) +]
[+ == "postbootstrap" +][+ (make-dep "" "") +]
[+ ESAC +][+ ENDFOR dependencies +]@endunless gcc-bootstrap

# Dependencies for target modules on other target modules are
# described by lang_env_dependencies; the defaults apply to anything
Expand Down
Loading

0 comments on commit 85e6cab

Please sign in to comment.