Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: add gcc module (help wanted) #3

Closed
wants to merge 1 commit into from

Conversation

dongcarl
Copy link

@dongcarl dongcarl commented Jul 3, 2018

Trying to add a gcc module as described here

Invoking ./mkroot.sh -n gcc gives the following stderr and stdout

Are the LFS instructions sound? Do I need to do this in multiple passes or is there a simpler alternative?

@landley
Copy link
Owner

landley commented Jul 3, 2018 via email

@dongcarl
Copy link
Author

dongcarl commented Jul 3, 2018

@landley I'm trying to build this using gcc simply because I want to produce a reproducible build for the gitian process, which currently uses gcc, I'm guessing using musl-cross-make will not produce the same binaries as gcc will? Also, I believe we're not using musl, but perhaps I can bring that up as a possible new target for future releases of bitcoin.

@landley
Copy link
Owner

landley commented Jul 3, 2018 via email

@dongcarl
Copy link
Author

dongcarl commented Jul 4, 2018

@landley I've been experimenting with mcm all day yesterday and have a preliminary module for it (that I can open a PR for as soon as you merge the checkout functionality).

I'm quite new to this cross compiling thing, so I want to validate a few of my observations and assumptions on running mcm-buildall.sh so I don't go down the wrong path...

My observations:

  1. When we have a directory that says $ARCH-linux-musl-cross, that means the gcc under this directory is an executable runnable on whatever architecture the host compiler was (in mcm-buildall.sh's case, i686), that will in turn produce executables runnable on $ARCH
  2. When we have a directory that says $ARCH-linux-musl-native, that means the gcc under this directory is an executable runnable on $ARCH that was produced using $ARCH-linux-musl-native

My mental model of mcm-buildall.sh is that it works like so:

  • Create i686-linux-musl bootstrap compiler linked against host libc
    • Create i686-linux-musl-cross from parent
      • Create i686-linux-musl-native from parent
      • Create *-linux-musl-cross from parent
        • Create *-linux-musl-native from parent

Is the above correct?

Questions:

  1. Are both *-cross and *-native compilers portable and statically linked? As in, can I copy them to a machine with their runnable architecture and just run them?
  2. For the "i686-linux-musl bootstrap compiler linked against host libc," does this mean that this bootstrap compiler produces musl executables, BUT this compiler itself was compiled using host libc?
  3. Why do we need the "i686-linux-musl bootstrap compiler linked against host libc"? Why not go straight to "i686-linux-musl-cross"?
  4. If I only wanted one tuple (say x86_64), I could change the script to do:
  • Create x86_64-linux-musl bootstrap compiler linked against host libc
    • Create x86_64-linux-musl-cross from parent
      • Create x86_64-linux-musl-native from parent

@landley
Copy link
Owner

landley commented Jul 5, 2018 via email

@landley landley closed this Aug 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants