Skip to content
This repository was archived by the owner on Feb 7, 2022. It is now read-only.
This repository was archived by the owner on Feb 7, 2022. It is now read-only.

provide additional header files #209

@nrobert13

Description

@nrobert13

I'm trying to compile a program which requires systemd's headers. like this:

GOPATH=/home/src xgo -x -v -image xgo-latest-sd ./

The Dockerfile of xgo-latest-sd looks like this, to add the required headers.

FROM karalabe/xgo-latest

RUN apt-get update && \
    apt-get install -y libsystemd-dev

the header is installed under:

# docker run --rm -it --entrypoint /usr/bin/find xgo-latest-sd -- /usr/ -name sd-journal.h
/usr/include/systemd/sd-journal.h

but as far as I can tell cgo doesn't find it due to -I $WORK/b206/

CGO_LDFLAGS='"-fPIE"' /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b206/ -importpath github.com/coreos/go-systemd/sdjournal -- -I $WORK/b206/ -fPIE ./journal.go
# github.com/coreos/go-systemd/sdjournal
/go/pkg/mod/github.com/coreos/go-systemd@v0.0.0-20191104093116-d3cd4ed1dbcf/sdjournal/journal.go:27:33: fatal error: systemd/sd-journal.h: No such file or directory
 // #include <systemd/sd-journal.h>
                                 ^
compilation terminated.

is there a way to get this compiled with xgo?

thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions