Skip to content

builder: refactor compiler-rt library #849

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

Closed
wants to merge 1 commit into from

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Jan 15, 2020

This refactor makes adding a new library (such as a libc) much easier in the future as it avoids a lot of duplicate code. Additionally, CI should become a little bit faster (~15s) as build-builtins now uses the build cache.

Example for picolibc:

var picolibc = Library{
        name: "picolibc",
        cflags: func() []string {
                picolibcDir := filepath.Join(goenv.Get("TINYGOROOT"), "lib/picolibc/newlib/libc")
                return []string{"-Werror", "-Wall", "-std=c11", "-D_COMPILING_NEWLIB", "-D_POSIX_C_SOURCE=200809L", "-fshort-enums", "--sysroot=" + picolibcDir, "-I" + picolibcDir + "/tinystdio"}
        },
        sourceDir: "lib/picolibc/newlib/libc",
        sources: func(target string) []string {
                return picolibcSources
        },
}

This refactor makes adding a new library (such as a libc) much easier in
the future as it avoids a lot of duplicate code. Additionally, CI should
become a little bit faster (~15s) as build-builtins now uses the build
cache.
@aykevl aykevl force-pushed the builder-refactor-libraries branch from ca1793e to 8864068 Compare January 18, 2020 01:24
This was referenced Jan 19, 2020
@aykevl
Copy link
Member Author

aykevl commented Jan 25, 2020

Replaced by #871.

@aykevl aykevl closed this Jan 25, 2020
@aykevl aykevl deleted the builder-refactor-libraries branch January 25, 2020 18:18
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.

1 participant