Skip to content

Commit da7571c

Browse files
committedApr 13, 2022
Fix issue with libmalloc variation string order: would build 'libemmalloc-ww-debug-noerrno' but try to use 'libemmalloc-debug-ww-noerrno'
1 parent c52006b commit da7571c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed
 

‎tools/system_libs.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -1302,9 +1302,14 @@ def get_base_name_prefix(self):
13021302
return 'lib%s' % self.malloc
13031303

13041304
def get_base_name(self):
1305-
name = super().get_base_name()
1305+
name = self.get_base_name_prefix()
13061306
if self.is_debug and not self.memvalidate and not self.verbose:
13071307
name += '-debug'
1308+
1309+
# Add the prefixes for malloc ('-mt' / '-ww') after the '-debug' part, since the -debug string
1310+
# is part of the user-submitted -sMALLOC prefix (e.g. -sMALLOC=dlmalloc-debug)
1311+
name += super().get_base_name().replace(self.get_base_name_prefix(), '')
1312+
13081313
if not self.use_errno:
13091314
# emmalloc doesn't actually use errno, but it's easier to build it again
13101315
name += '-noerrno'
@@ -1339,11 +1344,11 @@ def get_default_variation(cls, **kwargs):
13391344
@classmethod
13401345
def variations(cls):
13411346
combos = super().variations()
1342-
return ([dict(malloc='dlmalloc', **combo) for combo in combos if not combo['memvalidate'] and not combo['verbose']] +
1343-
[dict(malloc='emmalloc', **combo) for combo in combos if not combo['memvalidate'] and not combo['verbose']] +
1344-
[dict(malloc='emmalloc-memvalidate-verbose', **combo) for combo in combos if combo['memvalidate'] and combo['verbose']] +
1345-
[dict(malloc='emmalloc-memvalidate', **combo) for combo in combos if combo['memvalidate'] and not combo['verbose']] +
1346-
[dict(malloc='emmalloc-verbose', **combo) for combo in combos if combo['verbose'] and not combo['memvalidate']])
1347+
return ([dict(malloc='dlmalloc', **combo) for combo in combos if not combo['memvalidate'] and not combo['verbose']] +
1348+
[dict(malloc='emmalloc', **combo) for combo in combos if not combo['memvalidate'] and not combo['verbose']] +
1349+
[dict(malloc='emmalloc-memvalidate-verbose', **combo) for combo in combos if combo['memvalidate'] and combo['verbose']] +
1350+
[dict(malloc='emmalloc-memvalidate', **combo) for combo in combos if combo['memvalidate'] and not combo['verbose']] +
1351+
[dict(malloc='emmalloc-verbose', **combo) for combo in combos if not combo['memvalidate'] and combo['verbose']])
13471352

13481353

13491354
class libal(Library):

0 commit comments

Comments
 (0)
Failed to load comments.