Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 383121 - www-client/chromium using kerberos fails to build with app-crypt/heimdal
Summary: www-client/chromium using kerberos fails to build with app-crypt/heimdal
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 17:59 UTC by Ben Carrell
Modified: 2011-10-01 00:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed fix (gentoo383121a.patch,2.03 KB, patch)
2011-09-28 13:37 UTC, Martin von Gagern
Details | Diff
Undefine heimdal macros (gentoo383121b.patch,1.83 KB, patch)
2011-09-29 08:44 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Carrell 2011-09-15 17:59:59 UTC
It started about a month ago. Was using the ~x86 version when it started, I've tried using the dev builds with the same result. Using app-crypt/heimdal-1.5 kerberos implementation. Use flags are cups, gnome, gnome-keyring, kerberos.

Reproducible: Always

Steps to Reproduce:
1. Enable kerberos use flag for chromium
2. emerge chromium
3. build fails
Actual Results:  
Compile fails at:

i686-pc-linux-gnu-g++ '-DNO_HEAPCHECKER' '-DDISABLE_NACL' '-DCHROMIUM_BUILD' '-DENABLE_REMOTING=1' '-DENABLE_P2P_APIS=1' '-DENABLE_CONFIGURATION_POLICY' '-DENABLE_GPU=1' '-DENABLE_EGLIMAGE=1' '-DUSE_SKIA=1' '-DENABLE_REGISTER_PROTOCOL_HANDLER=1' '-DNET_IMPLEMENTATION' '-DUSE_KERBEROS' '-DENABLE_MEDIA_CODEC_THEORA' '-DENABLE_MEDIA_TYPE_OGG' '-DU_USING_ICU_NAMESPACE=0' '-DUSE_SYSTEM_ICU' '-DUSE_SYSTEM_ZLIB' '-DUSE_GCONF' '-DUSE_GIO' '-DDLOPEN_GSETTINGS' '-D__STDC_FORMAT_MACROS' '-DNDEBUG' '-DNVALGRIND' '-DDYNAMIC_ANNOTATIONS_ENABLED=0' -I. -Isdch/open-vcdiff/src -Iout/Release/obj/gen/net -Iv8/include -Inet/third_party/nss/ssl -pthread -fno-exceptions -Wall -Wno-unused-parameter -Wno-missing-field-initializers -D_FILE_OFFSET_BITS=64 -fvisibility=hidden -pipe -m32 -mmmx -fPIC -fno-strict-aliasing -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/libdrm -DORBIT2=1 -pthread -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/libdrm -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/nss -I/usr/include/nspr -O2 -fno-ident -fdata-sections -ffunction-sections -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -MMD -MF out/Release/.deps/out/Release/obj.target/net/net/http/http_auth_handler_factory.o.d.raw -O2 -march=core2 -pipe -c -o out/Release/obj.target/net/net/http/http_auth_handler_factory.o net/http/http_auth_handler_factory.cc
net/http/http_auth_gssapi_posix.cc:58:40: error: conflicting declaration 'gss_OID_desc_struct*& __gss_c_nt_user_name_oid_desc'
/usr/include/gssapi/gssapi.h:290:21: error: '__gss_c_nt_user_name_oid_desc' has a previous declaration as 'gss_OID_desc __gss_c_nt_user_name_oid_desc'
net/http/http_auth_gssapi_posix.cc:59:47: error: conflicting declaration 'gss_OID_desc_struct*& __gss_c_nt_machine_uid_name_oid_desc'
/usr/include/gssapi/gssapi.h:304:21: error: '__gss_c_nt_machine_uid_name_oid_desc' has a previous declaration as 'gss_OID_desc __gss_c_nt_machine_uid_name_oid_desc'
net/http/http_auth_gssapi_posix.cc:60:46: error: conflicting declaration 'gss_OID_desc_struct*& __gss_c_nt_string_uid_name_oid_desc'
/usr/include/gssapi/gssapi.h:318:21: error: '__gss_c_nt_string_uid_name_oid_desc' has a previous declaration as 'gss_OID_desc __gss_c_nt_string_uid_name_oid_desc'
net/http/http_auth_gssapi_posix.cc:61:50: error: conflicting declaration 'gss_OID_desc_struct*& __gss_c_nt_hostbased_service_x_oid_desc'
/usr/include/gssapi/gssapi.h:338:21: error: '__gss_c_nt_hostbased_service_x_oid_desc' has a previous declaration as 'gss_OID_desc __gss_c_nt_hostbased_service_x_oid_desc'
net/http/http_auth_gssapi_posix.cc:62:48: error: conflicting declaration 'gss_OID_desc_struct*& __gss_c_nt_hostbased_service_oid_desc'
/usr/include/gssapi/gssapi.h:352:21: error: '__gss_c_nt_hostbased_service_oid_desc' has a previous declaration as 'gss_OID_desc __gss_c_nt_hostbased_service_oid_desc'
net/http/http_auth_gssapi_posix.cc:63:40: error: conflicting declaration 'gss_OID_desc_struct*& __gss_c_nt_anonymous_oid_desc'
/usr/include/gssapi/gssapi.h:365:21: error: '__gss_c_nt_anonymous_oid_desc' has a previous declaration as 'gss_OID_desc __gss_c_nt_anonymous_oid_desc'
net/http/http_auth_gssapi_posix.cc:64:42: error: conflicting declaration 'gss_OID_desc_struct*& __gss_c_nt_export_name_oid_desc'
/usr/include/gssapi/gssapi.h:378:21: error: '__gss_c_nt_export_name_oid_desc' has a previous declaration as 'gss_OID_desc __gss_c_nt_export_name_oid_desc'
make: *** [out/Release/obj.target/net/net/http/http_auth_gssapi_posix.o] Error 1
make: *** Waiting for unfinished jobs....
/usr/libexec/paludis/utils/emake: emake returned error 2

Expected Results:  
Compile cleanly.

Package Manager Information:
    Package Name              paludis
    Package Version           0.66.0
    Build Date                2011-09-07T11:21:03-0600
    Built with CXX            i686-pc-linux-gnu-g++ 4.5.3
    Built with CXXFLAGS        -O2 -march=core2 -pipe -pedantic
    Built with LDFLAGS        -Wl,-O1 -Wl,--as-needed

Environment Information:
    Format                    paludis
    Config dir                /etc/paludis
    Root                      /
    System Root               /
    World file                /var/db/pkg/world

Repository layman:
    format                    unavailable
    location                  /var/db/paludis/repositories/layman
    sync                      tar+http://git.exherbo.org/layman_repositories.tar.bz2
    sync_options              

Repository gentoo:
    format                    e
    location                  /usr/portage
    builddir                  /var/tmp/paludis
    cache                     /usr/portage/metadata/cache
    distdir                   /usr/portage/distfiles
    eapi_when_unknown         0
    eapi_when_unspecified     0
    eclassdirs                /usr/portage/eclass
    layout                    traditional
    names_cache               /usr/portage/.cache/names
    newsdir                   /usr/portage/metadata/news
    profile_eapi_when_unspecified 0
    profile_layout            traditional
    profiles                  /usr/portage/profiles/default/linux/x86/10.0
    securitydir               /usr/portage/metadata/glsa
    setsdir                   /usr/portage/sets
    sync                      rsync://gentoo.cs.utah.edu/gentoo-portage
    sync_options              
    use_manifest              use
    write_cache               /var/cache/paludis/metadata
    Package information
        app-shells/bash       4.2_p10
        dev-java/java-config  2.1.11-r3
        dev-lang/python       2.7.2-r2 3.1.4-r2 3.2-r2
        dev-util/ccache       3.1.6
        dev-util/cmake        2.8.5-r2
        dev-util/pkgconfig    0.26
        sys-apps/baselayout   2.0.3
        sys-apps/openrc       0.9.3-r1
        sys-apps/sandbox      2.5
        sys-devel/autoconf    2.13 2.68
        sys-devel/automake    1.10.3 1.11.1-r1 1.9.6-r3
        sys-devel/binutils    2.21.1-r1
        sys-devel/gcc         4.5.3-r1
        sys-devel/gcc-config  1.4.1-r1
        sys-devel/libtool     2.4-r1
        sys-devel/make        3.82-r1
        sys-freebsd/freebsd-lib (none)
        sys-kernel/linux-headers 2.6.39
        sys-libs/glibc        2.13-r4
        sys-libs/uclibc       (none)

Repository installed:
    format                    vdb
    location                  /var/db/pkg
    builddir                  /var/tmp/paludis
    eapi_when_unknown         0
    names_cache               /var/db/pkg/.cache/names
    root                      /

Repository repository:
    format                    repository
    config_filename           /etc/paludis/repositories/%{repository_template_name}.conf
    config_template           /etc/paludis/repository.template
    root                      /

Repository vmware:
    format                    e
    location                  /var/db/paludis/repositories/vmware
    builddir                  /var/tmp/paludis
    cache                     /var/empty
    distdir                   /usr/portage/distfiles
    eapi_when_unknown         0
    eapi_when_unspecified     0
    eclassdirs                /usr/portage/eclass  /var/db/paludis/repositories/vmware/eclass
    layout                    traditional
    master_repository         gentoo
    names_cache               /var/db/paludis/repositories/vmware/.cache/names
    newsdir                   /var/db/paludis/repositories/vmware/metadata/news
    profile_eapi_when_unspecified 0
    profile_layout            traditional
    profiles                  /usr/portage/profiles/default/linux/x86/10.0
    securitydir               /var/db/paludis/repositories/vmware/metadata/glsa
    setsdir                   /var/db/paludis/repositories/vmware/sets
    sync                      svn://overlays.gentoo.org/proj/vmware/trunk
    sync_options              
    use_manifest              use
    write_cache               /var/cache/paludis/metadata

Repository wish:
    format                    e
    location                  /var/db/paludis/repositories/wish
    builddir                  /var/tmp/paludis
    cache                     /var/empty
    distdir                   /usr/portage/distfiles
    eapi_when_unknown         0
    eapi_when_unspecified     0
    eclassdirs                /usr/portage/eclass  /var/db/paludis/repositories/wish/eclass
    layout                    traditional
    master_repository         gentoo
    names_cache               /var/db/paludis/repositories/wish/.cache/names
    newsdir                   /var/db/paludis/repositories/wish/metadata/news
    profile_eapi_when_unspecified 0
    profile_layout            traditional
    profiles                  /usr/portage/profiles/default/linux/x86/10.0
    securitydir               /var/db/paludis/repositories/wish/metadata/glsa
    setsdir                   /var/db/paludis/repositories/wish/sets
    sync                      git://git.overlays.gentoo.org/user/wish.git git+http://git.overlays.gentoo.org/gitroot/user/wish.git git+ssh://git@git.overlays.gentoo.org/user/wish.git
    sync_options              
    use_manifest              use
    write_cache               /var/cache/paludis/metadata
Comment 1 Mike Gilbert gentoo-dev 2011-09-16 02:22:37 UTC
What version of chromium are you trying to build?
Comment 2 Ben Carrell 2011-09-16 16:10:43 UTC
Most recently, www-client/chromium-15.0.874.12. I first said it has been about a month, but looking at the logs it has only been a few weeks. :)
Comment 3 Martin von Gagern 2011-09-28 12:18:01 UTC
Same here, chromium-15.0.874.21 against heimdal-1.5 on ~amd64.

As the build log is so hard to read due to line wraps, I added some more breaks to make the first of these errors more readable:

net/http/http_auth_gssapi_posix.cc:58:9:
  error: conflicting declaration
  ‘gss_OID_desc_struct*& __gss_c_nt_user_name_oid_desc’
/usr/include/gssapi/gssapi.h:290:41:
  error: ‘__gss_c_nt_user_name_oid_desc’ has a previous declaration as
  ‘gss_OID_desc __gss_c_nt_user_name_oid_desc’

The heimdal gssapi.h code looks like this:
290: extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_user_name_oid_desc;
291: #define GSS_C_NT_USER_NAME (&__gss_c_nt_user_name_oid_desc)

So GSS_C_NT_USER_NAME is a preprocessor macro, and the "&" in its expansion is meant as an "address of" operator, not as a reference declaration.

The chromium file has this instead:
58: gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_VAL;

Both headers try to establish GSS_C_NT_USER_NAME as a token which can be used in applications, but as they follow different paths, their respective results are incompatible, and the error message looks somewhat strange.

As far as I can tell after a quick grep over the chromium source tree, none of these variables occurs anywhere outside the file http_auth_gssapi_posix.cc. So it shouldn't be important to have these names defined as symbols in the object files. They might as wel have been declared static.

For this reason, I suggest simply using the heimdal definition if it is available, enclosing the chromium definitions in #ifdefs. Will write a patch and try it out shortly.
Comment 4 Martin von Gagern 2011-09-28 13:37:54 UTC
Created attachment 288085 [details, diff]
Proposed fix

Compiles all right for me. Haven't tried establishing a connection using a kerberos ticket, due to lack of a working kerberos infrastructure.
Comment 5 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2011-09-28 22:19:49 UTC
The suggested fix doesn't work for me. There is the following linking error:

out/Release/obj.target/net/net/http/http_auth_gssapi_posix.o: In function `net::(anonymous namespace)::DescribeOid(net::GSSAPILibrary*, gss_OID_desc_struct*)':
http_auth_gssapi_posix.cc:(.text._ZN3net12_GLOBAL__N_111DescribeOidEPNS_13GSSAPILibraryEP19gss_OID_desc_struct+0x1f0): undefined reference to `__gss_c_nt_user_name_oid_desc'
http_auth_gssapi_posix.cc:(.text._ZN3net12_GLOBAL__N_111DescribeOidEPNS_13GSSAPILibraryEP19gss_OID_desc_struct+0x22d): undefined reference to `__gss_c_nt_machine_uid_name_oid_desc'
http_auth_gssapi_posix.cc:(.text._ZN3net12_GLOBAL__N_111DescribeOidEPNS_13GSSAPILibraryEP19gss_OID_desc_struct+0x26d): undefined reference to `__gss_c_nt_string_uid_name_oid_desc'
http_auth_gssapi_posix.cc:(.text._ZN3net12_GLOBAL__N_111DescribeOidEPNS_13GSSAPILibraryEP19gss_OID_desc_struct+0x2ad): undefined reference to `__gss_c_nt_hostbased_service_x_oid_desc'
http_auth_gssapi_posix.cc:(.text._ZN3net12_GLOBAL__N_111DescribeOidEPNS_13GSSAPILibraryEP19gss_OID_desc_struct+0x2ed): undefined reference to `__gss_c_nt_hostbased_service_oid_desc'
http_auth_gssapi_posix.cc:(.text._ZN3net12_GLOBAL__N_111DescribeOidEPNS_13GSSAPILibraryEP19gss_OID_desc_struct+0x32d): undefined reference to `__gss_c_nt_anonymous_oid_desc'
http_auth_gssapi_posix.cc:(.text._ZN3net12_GLOBAL__N_111DescribeOidEPNS_13GSSAPILibraryEP19gss_OID_desc_struct+0x36d): undefined reference to `__gss_c_nt_export_name_oid_desc'
/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.
collect2: ld returned 1 exit status
make: *** [out/Release/chrome] Error 1
emake failed
 * ERROR: www-client/chromium-15.0.874.21 failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  56:  Called src_compile
 *   environment, line 6343:  Called die
 * The specific snippet of code:
 *       emake chrome chrome_sandbox BUILDTYPE=Release V=1 || die;
 * 
 * If you need support, post the output of 'emerge --info =www-client/chromium-15.0.874.21',
 * the complete build log and the output of 'emerge -pqv =www-client/chromium-15.0.874.21'.
 * This ebuild is from an overlay named 'x-portage': '/usr/local/portage/'
 * The complete build log is located at '/var/tmp/portage/www-client/chromium-15.0.874.21/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-client/chromium-15.0.874.21/temp/environment'.
 * S: '/var/tmp/portage/www-client/chromium-15.0.874.21/work/chromium-15.0.874.21'

Note that this works fine with stable heimdal 1.3.3-r1 without any patches.
Comment 6 Martin von Gagern 2011-09-29 08:36:37 UTC
(In reply to comment #5)
> The suggested fix doesn't work for me. There is the following linking error:

Apparently chromium doesn't directly link against the system libgssapi, which to me seems to be a very bad thing: you shouldn't be using system headers unless you were using the libraries that go with it. Apparently things worked out for me because I've got chromium[cups] and cups[kerberos], so the dependency was there indirectly. Maybe I should add --no-copy-dt-needed-entries to my LDFLAGS, to discover this kind of underlinking issue at build time.

> Note that this works fine with stable heimdal 1.3.3-r1 without any patches.

Starting with heimdal 1.4, the inclusion of the following changeset will break things: http://repo.or.cz/w/heimdal.git/commit/1021099f3df5
So before then, the tokens were not handled by the preprocessor, but instead were global variables declared in just the way chromium uses them. For this reason, the declarations didn't conflict, allwing chromium to compile.
Comment 7 Martin von Gagern 2011-09-29 08:44:02 UTC
Created attachment 288189 [details, diff]
Undefine heimdal macros

This should work, although my system is still busy compiling chromium with this patch in place. If you don't hear from me within the hour, it will have succeeded.
Comment 8 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2011-10-01 00:06:30 UTC
Fixed without revbump, thanks for the patch! I also applied this upstream.