Skip to content

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.

2 participants