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

interactive builds: /ro/include/iconv.h is picked up from libiconv instead of glibc #65

Open
stapelberg opened this issue Feb 16, 2020 · 2 comments
Labels
bug Something isn't working buildfail package fails to build

Comments

@stapelberg
Copy link
Member

stapelberg commented Feb 16, 2020

Currently using the following workaround to build i3 from git:

CPATH=/ro/glibc-amd64-2.27-3/out/include:$CPATH make -j8

Need to look into why configure does not detect -liconv, but linking fails without it (unless using the workaround).

@stapelberg stapelberg added bug Something isn't working buildfail package fails to build labels Feb 16, 2020
@stapelberg
Copy link
Member Author

stapelberg commented Feb 16, 2020

The glibc include dir is missing from the wrapper script contents because of

distri/cmd/distri/build.go

Lines 734 to 745 in 54756a6

// Exclude glibc from CPATH: it needs to come last (as /usr/include),
// and gcc doesn’t recognize that the non-system directory glibc-2.27
// duplicates the system directory /usr/include because we only symlink
// the contents, not the whole directory.
if dep != "glibc-amd64-2.27-4" && dep != "glibc-i686-amd64-2.27-4" &&
dep != "glibc-amd64-2.27-3" && dep != "glibc-i686-amd64-2.27-3" &&
dep != "glibc-amd64-2.27-2" && dep != "glibc-i686-amd64-2.27-2" &&
dep != "glibc-amd64-2.27-1" && dep != "glibc-i686-amd64-2.27-1" &&
dep != "glibc-amd64-2.27" && dep != "glibc-i686-amd64-2.27" {
includeDirs = append(includeDirs, "/ro/"+dep+"/out/include")
includeDirs = append(includeDirs, "/ro/"+dep+"/out/include/x86_64-linux-gnu")
}

Maybe we need to look into teaching gcc that /ro/glibc…/out/include is a system directory?

@stapelberg
Copy link
Member Author

stapelberg commented Feb 16, 2020

Need to look into why configure does not detect -liconv, but linking fails without it (unless using the workaround).

Turns out that autoconf’s AC_SEARCH_LIBS does not put an #include directive into its conftest.c file, so it gets the builtin iconv instead of the one requiring libiconv.

Fixing this in i3’s configure.ac in i3/i3#3942, but of course other upstream software might still use AC_SEARCH_LIBS for detecting iconv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working buildfail package fails to build
Projects
None yet
Development

No branches or pull requests

1 participant