Skip to content

Commit acc874f

Browse files
committed
Revert "bootstrap.py: respect crt-static"
This reverts commit 5ecf29d.
1 parent 4796871 commit acc874f

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

src/bootstrap/bootstrap.py

+3-30
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def bin_root(self):
489489
"""
490490
return os.path.join(self.build_dir, self.build, "stage0")
491491

492-
def get_toml(self, key, section=None):
492+
def get_toml(self, key):
493493
"""Returns the value of the given key in config.toml, otherwise returns None
494494
495495
>>> rb = RustBuild()
@@ -501,29 +501,12 @@ def get_toml(self, key, section=None):
501501
502502
>>> rb.get_toml("key3") is None
503503
True
504-
505-
Optionally also matches the section the key appears in
506-
507-
>>> rb.config_toml = '[a]\\nkey = "value1"\\n[b]\\nkey = "value2"'
508-
>>> rb.get_toml('key', 'a')
509-
'value1'
510-
>>> rb.get_toml('key', 'b')
511-
'value2'
512-
>>> rb.get_toml('key', 'c') is None
513-
True
514504
"""
515-
516-
cur_section = None
517505
for line in self.config_toml.splitlines():
518-
section_match = re.match(r'^\s*\[(.*)\]\s*$', line)
519-
if section_match is not None:
520-
cur_section = section_match.group(1)
521-
522506
match = re.match(r'^{}\s*=(.*)$'.format(key), line)
523507
if match is not None:
524508
value = match.group(1)
525-
if section is None or section == cur_section:
526-
return self.get_string(value) or value.strip()
509+
return self.get_string(value) or value.strip()
527510
return None
528511

529512
def cargo(self):
@@ -606,17 +589,7 @@ def build_bootstrap(self):
606589
env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
607590
(os.pathsep + env["LIBRARY_PATH"]) \
608591
if "LIBRARY_PATH" in env else ""
609-
env["RUSTFLAGS"] = "-Cdebuginfo=2 "
610-
611-
build_section = "target.{}".format(self.build_triple())
612-
target_features = []
613-
if self.get_toml("crt-static", build_section) == "true":
614-
target_features += ["+crt-static"]
615-
elif self.get_toml("crt-static", build_section) == "false":
616-
target_features += ["-crt-static"]
617-
if target_features:
618-
env["RUSTFLAGS"] += "-C target-feature=" + (",".join(target_features)) + " "
619-
592+
env["RUSTFLAGS"] = "-Cdebuginfo=2"
620593
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
621594
os.pathsep + env["PATH"]
622595
if not os.path.isfile(self.cargo()):

0 commit comments

Comments
 (0)