Move the gold linker support to the python configure

RESOLVED FIXED in Firefox 56

Status

()

Firefox
Build Config
RESOLVED FIXED
a year ago
10 months ago

People

(Reporter: sylvestre, Assigned: sylvestre)

Tracking

(Depends on: 1 bug)

Trunk
Firefox 56
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox55 wontfix, firefox56 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
As suggested in bug 1336978
Comment hidden (mozreview-request)
(Assignee)

Comment 2

a year ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review126540

::: build/autoconf/compiler-opts.m4
(Diff revision 1)
>      ## to typedef it to a C type with the same layout when the headers are included
>      ## from C.
>      _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-unknown-warning-option -Wno-return-type-c-linkage"
>  fi
>  
> -if test -n "$DEVELOPER_OPTIONS"; then

I am not managing $DEVELOPER_OPTIONS yet. Not sure how to pass these information from the python configure to the old configure.
(Assignee)

Comment 3

a year ago
Here, I would appreciate suggestions and comments :)
You can use `add_old_configure_assignment` to pass variables into old-configure, like:
https://dxr.mozilla.org/mozilla-central/rev/9577ddeaafd85554c2a855f385a87472a089d5c0/build/moz.configure/toolchain.configure#63

Comment 5

a year ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review127088

::: build/moz.configure/toolchain.configure:974
(Diff revision 1)
>  
> +
> +# Linker detection
> +# ==============================================================
> +
> +option('--enable-gold', nargs=0, env='MOZ_FORCE_GOLD', when=non_msvc_compiler,

nargs=0 is the default.

::: build/moz.configure/toolchain.configure:980
(Diff revision 1)
> +       help='Enable GNU Gold Linker when it is not already the default')
> +
> +@depends("--enable-gold", c_compiler,
> +         try_compile(check_msg='for gold linker',
> +                     flags=['-fuse-ld=gold'],
> +                     onerror=lambda: die('-fuse-ld=gold not working')),

You're replacing the -B trick with -fuse-ld=gold. Which is not merely "moving to python configure" as claimed in the commit message. Also, the discussion in the other bug made it clear we still need the -B trick, so you should start moving that, then add -fuse-ld=gold.

::: build/moz.configure/toolchain.configure:985
(Diff revision 1)
> +                     onerror=lambda: die('-fuse-ld=gold not working')),
> +                     when=non_msvc_compiler)
> +def enable_gold(target, c_compiler, has_gold):
> +    if has_gold:
> +        return "-fuse-ld=gold"
> +    if "GNU ld" in check_cmd_output(c_compiler.compiler, '-fuse-ld=gold'):

c_compiler.wrapper should be somewhere in here, and maybe even c_compiler.flags...

::: build/moz.configure/toolchain.configure:986
(Diff revision 1)
> +                     when=non_msvc_compiler)
> +def enable_gold(target, c_compiler, has_gold):
> +    if has_gold:
> +        return "-fuse-ld=gold"
> +    if "GNU ld" in check_cmd_output(c_compiler.compiler, '-fuse-ld=gold'):
> +        set_config('LD_IS_BFD', 1)

You can't use set_config inside a function. Which I already mentioned in bug 1336978 comment 7 ;)

Comment 6

a year ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review127100
Attachment #8851824 - Flags: review?(mh+mozilla)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 9

a year ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review129248

::: build/autoconf/compiler-opts.m4
(Diff revision 3)
>      ## to typedef it to a C type with the same layout when the headers are included
>      ## from C.
>      _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-unknown-warning-option -Wno-return-type-c-linkage"
>  fi
>  
> -if test -n "$DEVELOPER_OPTIONS"; then

You're not handling this in python configure.
I think you should actually start with this one, meaning moving MOZILLA_OFFICIAL and --enable-release to python.

::: build/moz.configure/toolchain.configure:978
(Diff revision 3)
> +         try_compile(check_msg='for gold linker',
> +                     flags=['-fuse-ld=gold'],
> +                     onerror=lambda: die('-fuse-ld=gold not working')),
> +                     when=non_msvc_compiler)

This test still relies on -fuse-ld=gold, so this won't ever enable the -B thing on versions that don't support -fuse-ld=gold.

::: build/moz.configure/toolchain.configure:1002
(Diff revision 3)
> +
> +        if os.path.exists(targetDir):
> +            shutil.rmtree(targetDir)
> +        os.makedirs(targetDir)
> +        os.symlink(goldFullPath, os.path.join(targetDir, "ld.gold"))
> +        linker = " -B " + targetDir

it would be better to set that as a list.

::: build/moz.configure/toolchain.configure:1002
(Diff revision 3)
> +
> +        if os.path.exists(targetDir):
> +            shutil.rmtree(targetDir)
> +        os.makedirs(targetDir)
> +        os.symlink(goldFullPath, os.path.join(targetDir, "ld.gold"))
> +        linker = " -B " + targetDir

You're not testing that the trick actually works, like the shell code does.

::: build/moz.configure/toolchain.configure:1003
(Diff revision 3)
> +        if os.path.exists(targetDir):
> +            shutil.rmtree(targetDir)
> +        os.makedirs(targetDir)
> +        os.symlink(goldFullPath, os.path.join(targetDir, "ld.gold"))
> +        linker = " -B " + targetDir
> +        # Will be replaced by linker = "-fuse-ld=gold"

This comment is kind of irrelevant :)

::: build/moz.configure/toolchain.configure:1008
(Diff revision 3)
> +        # Will be replaced by linker = "-fuse-ld=gold"
> +        return namespace(
> +            LINKER_FLAG=linker,
> +        )
> +
> +    if "GNU ld" in check_cmd_output(c_compiler.wrapper, c_compiler.compiler, c_compiler.flags, '-fuse-ld=gold') and linker is not None:

wrapper and flags are lists, you can't pass them to check_cmd_output this way.

Something like
  cmd = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags + [...]
  check_cmd_output(*cmd)

should work.
Attachment #8851824 - Flags: review?(mh+mozilla)
(Assignee)

Updated

a year ago
Depends on: 1354581
(Assignee)

Comment 10

a year ago
mozreview-review-reply
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review126540

> I am not managing $DEVELOPER_OPTIONS yet. Not sure how to pass these information from the python configure to the old configure.

done here https://reviewboard.mozilla.org/r/127726/
Comment hidden (mozreview-request)

Comment 12

a year ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review131100

We're getting close.

::: build/moz.configure/toolchain.configure:1000
(Diff revision 4)
> +@imports('os')
> +@imports('shutil')
> +def enable_gold(target, c_compiler, enable_release):
> +    linker = None
> +    # Used to check if the kind of linker
> +    version_check = [u'-Wl,--version']

string literals are unicode in configure, you don't need the u.

::: build/moz.configure/toolchain.configure:1004
(Diff revision 4)
> +    # Used to check if the kind of linker
> +    version_check = [u'-Wl,--version']
> +    cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags
> +    if target or not enable_release:
> +        # Try to force the usage of gold
> +        topobjdir = os.path.realpath(os.path.abspath('.'))

add a depends on `check_build_environment`, and you'll have topobjdir as an attribute of the corresponding function argument (see for example default_project() in init.configure)

::: build/moz.configure/toolchain.configure:1005
(Diff revision 4)
> +    version_check = [u'-Wl,--version']
> +    cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags
> +    if target or not enable_release:
> +        # Try to force the usage of gold
> +        topobjdir = os.path.realpath(os.path.abspath('.'))
> +        targetDir = topobjdir + "/build/unix/gold/"

use os.path.join()

::: build/moz.configure/toolchain.configure:1007
(Diff revision 4)
> +        if gold.startswith("/"):
> +            goldFullPath = gold
> +        else:
> +            goldFullPath = find_program(gold)

find_program should actually work in both cases.

::: build/moz.configure/toolchain.configure:1014
(Diff revision 4)
> +        if os.path.exists(targetDir):
> +            shutil.rmtree(targetDir)
> +        os.makedirs(targetDir)

This is more aggressive than the corresponding shell code.

::: build/moz.configure/toolchain.configure:1023
(Diff revision 4)
> +
> +        linker = ['-B', targetDir]
> +        cmd = cmd_base + linker + version_check
> +        if u"GNU gold" in check_cmd_output(*cmd):
> +            # We have a detect gold, will build with the -B workaround
> +            log.info("checking for linker... using gold linker")

Instead of doing this, you should be able to add something like
KIND='bfd'/'gold'
to the returned namespaces, and add
@checking('for ld', lambda x: x.KIND)
on top of the function.
Attachment #8851824 - Flags: review?(mh+mozilla)
(Assignee)

Comment 13

a year ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review140772
Comment hidden (mozreview-request)

Comment 15

11 months ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review155992

::: build/moz.configure/toolchain.configure:1005
(Diff revision 5)
> +    # Used to check if the kind of linker
> +    version_check = ['-Wl,--version']
> +    cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags
> +    if target or not enable_release:
> +        # Try to force the usage of gold
> +        topobjdir = os.path.realpath(os.path.abspath('.'))

Please address the remaining issue from last review.
Attachment #8851824 - Flags: review?(mh+mozilla)
(Assignee)

Comment 16

11 months ago
I was waiting for bug 1354581 to land.
I will do once it is
(Assignee)

Comment 17

11 months ago
mozreview-review-reply
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review131100

> This is more aggressive than the corresponding shell code.

is that an issue? :)

> Instead of doing this, you should be able to add something like
> KIND='bfd'/'gold'
> to the returned namespaces, and add
> @checking('for ld', lambda x: x.KIND)
> on top of the function.

Doing that causes the following error ?! Any clue why?

0:01.72   File "/home/sylvestre/dev/mozilla/mozilla-inbound.hg/build/moz.configure/toolchain.configure", line 1013, in enable_gold
 0:01.72     if os.path.exists(targetDir):
 0:01.72 AttributeError: 'ReadOnlyNamespace' object has no attribute 'exists'
Move @checking above @imports
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 21

11 months ago
For now, fails on windows with:

12:24:47     INFO -  DEBUG: Executing: `z:/task_1498303545/build/src/clang/bin/clang-cl.exe -Xclang -std=gnu99 -Wl,--version`
12:24:47     INFO -  DEBUG: The command returned non-zero exit status 1.
12:24:47     INFO -  DEBUG: Its error output was:
12:24:47     INFO -  DEBUG: | clang-cl.exe: error: no input files
12:24:47     INFO -  ERROR: Command `z:/task_1498303545/build/src/clang/bin/clang-cl.exe -Xclang -std=gnu99 -Wl,--version` failed with exit status 1.

and linux with:

[task 2017-06-24T12:42:10.140011Z] 12:42:10     INFO -   File "/home/worker/workspace/build/src/config/mozunit.py", line 77, in printFail
[task 2017-06-24T12:42:10.140246Z] 12:42:10     INFO -     message = value.message.splitlines()[0] if value.message else 'NO MESSAGE'
[task 2017-06-24T12:42:10.140440Z] 12:42:10     INFO - AttributeError: 'int' object has no attribute 'splitlines'
[task 2017-06-24T12:42:10.140724Z] 12:42:10  WARNING - TEST-UNEXPECTED-FAIL | No test output (missing mozunit.main() call?): /home/worker/workspace/build/src/python/mozbuild/mozbuild/test/configure/test_moz_configure.py
[task 2017-06-24T12:42:10.140968Z] 12:42:10     INFO - Setting retcode to 1 from /home/worker/workspace/build/src/python/mozbuild/mozbuild/test/configure/test_moz_configure.py
(Assignee)

Updated

11 months ago
Attachment #8851824 - Flags: review?(mh+mozilla)
Comment hidden (mozreview-request)
(Assignee)

Updated

11 months ago
Depends on: 1376230
(Assignee)

Comment 23

11 months ago
Linux is now working \o/
Now, Mac & Windows!
(Assignee)

Comment 24

11 months ago
Mike, do you have any recommendations on how to handle Mac & Windows?
-Wl,--version is not handled for both.
Flags: needinfo?(mh+mozilla)

Comment 25

11 months ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review159250

::: build/moz.configure/toolchain.configure:1069
(Diff revision 8)
> +
> +# Linker detection
> +# ==============================================================
> +
> +option('--enable-gold', env='MOZ_FORCE_GOLD',
> +       help='Enable GNU Gold Linker when it is not already the default')

Fow Mac/Windows, you want to add a @depends function that returns true for non-mac non-windows builds, and add it as a when here.

::: build/moz.configure/toolchain.configure:1076
(Diff revision 8)
> +
> +@depends('--enable-gold', c_compiler, developer_options, check_build_environment)
> +@checking('for ld', lambda x: x.KIND)
> +@imports('os')
> +@imports('shutil')
> +def enable_gold(target, c_compiler, developer_options, build_env):

target is a confusing name for this argument (we use that for things related with --target, as opposed to --host)

::: build/moz.configure/toolchain.configure:1078
(Diff revision 8)
> +@checking('for ld', lambda x: x.KIND)
> +@imports('os')
> +@imports('shutil')
> +def enable_gold(target, c_compiler, developer_options, build_env):
> +    linker = None
> +    # Used to check if the kind of linker

s/if// ?

::: build/moz.configure/toolchain.configure:1086
(Diff revision 8)
> +    if target or developer_options:
> +        # Try to force the usage of gold
> +        targetDir = os.path.join(build_env.topobjdir, 'build', 'unix', 'gold')
> +
> +        gold = check_cmd_output(c_compiler.compiler, '-print-prog-name=ld.gold').strip()
> +        goldFullPath = find_program(gold)

may want to check that gold is not empty before doing this.

::: build/moz.configure/toolchain.configure:1098
(Diff revision 8)
> +        os.symlink(goldFullPath, os.path.join(targetDir, 'ld'))
> +
> +        linker = ['-B', targetDir]
> +        cmd = cmd_base + linker + version_check
> +        if 'GNU gold' in check_cmd_output(*cmd).decode('utf-8'):
> +            # We have a detect gold, will build with the -B workaround

s/detect/detected/
Attachment #8851824 - Flags: review?(mh+mozilla)

Updated

11 months ago
Flags: needinfo?(mh+mozilla)
Comment hidden (mozreview-request)
(Assignee)

Comment 27

11 months ago
mozreview-review-reply
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review159250

> Fow Mac/Windows, you want to add a @depends function that returns true for non-mac non-windows builds, and add it as a when here.

Done but I am getting:

mozbuild.configure.ConfigureError: @depends function needs the same `when` as options it depends on

I tried many different combinations but could not fix it :(
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 30

11 months ago
Finally green!

Comment 31

11 months ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review161084

::: build/moz.configure/toolchain.configure:1092
(Diff revision 11)
> +    cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags
> +    if enable_gold_option or developer_options:
> +        # Try to force the usage of gold
> +        targetDir = os.path.join(build_env.topobjdir, 'build', 'unix', 'gold')
> +
> +        gold_detection_cmd = '-print-prog-name=ld.gold'

s/_cmd/_arg/

::: build/moz.configure/toolchain.configure:1095
(Diff revision 11)
> +        targetDir = os.path.join(build_env.topobjdir, 'build', 'unix', 'gold')
> +
> +        gold_detection_cmd = '-print-prog-name=ld.gold'
> +        gold = check_cmd_output(c_compiler.compiler, gold_detection_cmd).strip()
> +        if not gold:
> +            configure_error('{} {} did not return anything'.format(

s/configure_error/die/

"Could not find gold" should be enough of an error message. The debug output that shows up on die() should be enough to get that information about the command that failed.

Also, this should only really fail when --enable-gold was explicitly given, not when it's implicitly enabled through developer options.

::: build/moz.configure/toolchain.configure:1101
(Diff revision 11)
> +                c_compiler.compiler,
> +                gold_detection_cmd))
> +
> +        goldFullPath = find_program(gold)
> +        if goldFullPath is None:
> +            configure_error('Could not find the actual path to {}'.format(gold))

Same as above.

::: build/moz.configure/toolchain.configure:1123
(Diff revision 11)
> +            shutil.rmtree(targetDir)
> +
> +    cmd = cmd_base + version_check
> +    # using decode because ld can be localized and python will
> +    # have problems with french accent for example
> +    if 'GNU ld' in check_cmd_output(*cmd).decode('utf-8'):

You should store the result from check_cmd_output for this check and the one for android below, instead of having the command run twice for the latter case.

::: build/moz.configure/toolchain.configure:1136
(Diff revision 11)
> +    if 'GNU gold' in check_cmd_output(*cmd).decode('utf-8'):
> +        return namespace(
> +            KIND='gold'
> +        )
> +
> +    configure_error("Could not find any linker")

die.

::: build/moz.configure/toolchain.configure:1139
(Diff revision 11)
> +        )
> +
> +    configure_error("Could not find any linker")
> +
> +
> +set_config('LD_IS_BFD', enable_gold.LD_IS_BFD)

set_config('LD_IS_BFD', depends(enable_gold.KIND)(lambda x: x == 'bfd' or None))

and then, you don't need LD_IS_BFD set in the namespace on line 1127.
Attachment #8851824 - Flags: review?(mh+mozilla)
(Assignee)

Comment 32

11 months ago
mozreview-review-reply
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review161084

> s/configure_error/die/
> 
> "Could not find gold" should be enough of an error message. The debug output that shows up on die() should be enough to get that information about the command that failed.
> 
> Also, this should only really fail when --enable-gold was explicitly given, not when it's implicitly enabled through developer options.

Fixed everything besides the last line. 

I think I can fix that in a follow up if you agree. To me, this is an improvement.
Comment hidden (mozreview-request)

Comment 34

10 months ago
mozreview-review
Comment on attachment 8851824 [details]
Bug 1351109 - Move the gold linker support to the python configure

https://reviewboard.mozilla.org/r/124024/#review163186

Please do fix it, though.
Attachment #8851824 - Flags: review?(mh+mozilla) → review+
(Assignee)

Updated

10 months ago
Depends on: 1381741

Comment 35

10 months ago
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d0e782180741
Move the gold linker support to the python configure r=glandium
(Assignee)

Comment 36

10 months ago
Causing some linking errors in debug mode.
Tomcat, could you backout the change?

[task 2017-07-18T07:02:13.498960Z] 07:02:13     INFO -      INPUT("StaticXULComponentsEnd/StaticXULComponentsEnd.o")
[task 2017-07-18T07:02:13.499156Z] 07:02:13     INFO -  ../../dom/animation/Unified_cpp_dom_animation0.o: In function `mozilla::ServoStyleContext::Release()':
[task 2017-07-18T07:02:13.499352Z] 07:02:13     INFO -  /home/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleContext.h:39: undefined reference to `Servo_StyleContext_Release'
[task 2017-07-18T07:02:13.499538Z] 07:02:13     INFO -  /home/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleContext.h:39: undefined reference to `Servo_StyleContext_Release'
[task 2017-07-18T07:02:13.499712Z] 07:02:13     INFO -  ../../layout/style/Unified_cpp_layout_style3.o: In function `mozilla::ServoStyleContext::Release()':
[task 2017-07-18T07:02:13.499905Z] 07:02:13     INFO -  /home/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleContext.h:39: undefined reference to `Servo_StyleContext_Release'
[task 2017-07-18T07:02:13.500091Z] 07:02:13     INFO -  /home/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleContext.h:39: undefined reference to `Servo_StyleContext_Release'
[task 2017-07-18T07:02:13.500283Z] 07:02:13     INFO -  /home/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleContext.h:39: undefined reference to `Servo_StyleContext_Release'
[task 2017-07-18T07:02:13.500484Z] 07:02:13     INFO -  ../../layout/base/Unified_cpp_layout_base0.o:/home/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleContext.h:39: more undefined references to `Servo_StyleContext_Release' follow
[task 2017-07-18T07:02:13.500636Z] 07:02:13     INFO -  collect2: error: ld returned 1 exit status
[task 2017-07-18T07:02:13.556670Z] 07:02:13     INFO -  /home/worker/workspace/build/src/config/rules.mk:717: recipe for target 'libxul.so' failed
Flags: needinfo?(cbook)
I think you landed on top of bustage. Plus these changes shouldn't have changed anything for automated builds.
(Assignee)

Comment 38

10 months ago
ok, thanks
Flags: needinfo?(cbook)

Comment 39

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d0e782180741
Status: NEW → RESOLVED
Last Resolved: 10 months ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Fwiw, this broke all the BSDs:
http://buildbot.rhaalovely.net/builders/mozilla-central-freebsd-amd64/builds/1254
http://buildbot.rhaalovely.net/builders/mozilla-central-amd64/builds/2149
http://buildbot.rhaalovely.net/builders/mozilla-central-i386/builds/969

 0:21.94 checking for 64-bit OS... yes
 0:21.94 checking bindgen cflags... no
 0:22.00 checking for ld...
 0:22.00 DEBUG: Executing: `/usr/local/bin/clang -print-prog-name=ld.gold`
 0:22.00 ERROR: Could not find gold
That's bug 1381741, but you should build with --enable-release anyways (which would solve the problem too).
wtf ? --enable-release when building m-c ? is that a joke ? is that mandatory to explicitely use that option now ?
Note that we build with almost default options, we never passed --enable-gold..

mk_add_options MOZ_OBJDIR=/build/obj/buildslave/mozilla-central
mk_add_options PYTHON=/usr/local/bin/python2.7
mk_add_options AUTOCLOBBER=1

export LDFLAGS=-Wl,--no-keep-memory

# set compiler
export CC=/usr/local/bin/clang
export CXX=/usr/local/bin/clang++

ac_add_options --prefix=/usr/local
A default build assumes things can be tweaked for local development, and as such, tries to use not-entirely-best options by default. That includes gold, disabling identical code folding and a few other things. People who want to distribute Firefox are advised to use --enable-release. Actually, people that distribute Firefox with the Firefox branding should even be setting MOZILLA_OFFICIAL, which turns --enable-release on automatically.

Comment 44

10 months ago
Solaris is broken the same way:

 0:24.00 checking for ld...
 0:24.01 DEBUG: Executing: `/usr/bin/gcc -print-prog-name=ld.gold`
 0:24.01 ERROR: Could not find gold

Comment 45

10 months ago
"--enable-release" desn't seem to help on Solaris:

 0:17.01 checking for ld...
 0:17.01 DEBUG: Executing: `/usr/bin/gcc -std=gnu99 -Wl,--version`
 0:17.01 DEBUG: The command returned non-zero exit status 1.
 0:17.01 DEBUG: Its error output was:
 0:17.01 DEBUG: | collect2 version 5.4.0
 0:17.01 DEBUG: | /usr/bin/ld -Y P,/lib/amd64:/usr/lib/amd64 -Qy /usr/lib/amd64/crt1.o /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.12/5.4.0/crtp.o /usr/lib/amd64/crti.o /usr/lib/amd64/values-Xa.o /usr/lib/amd64/values-xpg6.o /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.12/5.4.0/crtbegin.o -L/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.12/5.4.0 -L/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.12/5.4.0/../../../amd64 -L/lib/amd64 -L/usr/lib/amd64 -L/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.12/5.4.0/../../.. --version -lgcc -z ignore -lgcc_s -z record -lc -lgcc -z ignore -lgcc_s -z record /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.12/5.4.0/crtend.o /usr/lib/amd64/crtn.o
 0:17.01 DEBUG: | ld: Software Generation Utilities - Solaris Link Editors: 5.12-1.3113
 0:17.01 DEBUG: | Undefined                     first referenced
 0:17.01 DEBUG: |  symbol                           in file
 0:17.01 DEBUG: | main                                /usr/lib/amd64/crt1.o
 0:17.01 DEBUG: | ld: fatal: symbol referencing errors
 0:17.01 DEBUG: | collect2: error: ld returned 1 exit status
 0:17.01 ERROR: Command `/usr/bin/gcc -std=gnu99 -Wl,--version` failed with exit status 1.
(Assignee)

Comment 46

10 months ago
Please open follow up bugs.
thanks

Comment 47

10 months ago
I have filed Bug 1382364.
(Assignee)

Updated

10 months ago
Depends on: 1382364

Updated

10 months ago
Blocks: 1383966

Comment 48

10 months ago
Too late for 55. Mark 55 won't fix.
status-firefox55: affected → wontfix
You need to log in before you can comment on or make changes to this bug.