Trident 18.12 Prerelease 2: Chromium Issue


#1

Hello Guys

Upon upgrade to latest build I found chromium does not start up because environ external definition could not be found. While really the C library containing the symbol is on the system because a simple C program compiles, links and runs printing the environment successfully.

This is the runtime linkage error:

ld-elf.so.1: /usr/local/lib/libglib-2.0.so.0: Undefined symbol “environ”

When trying to rebuild port compilation fails due not finding appropriate x86intrin.h:

…/…/third_party/angle/src/common/platform.h:91:10: fatal error: ‘x86intrin.h’ file not found

which is located as follows upon GCC8 installtion from pkg:

/usr/local/lib/gcc8/gcc/x86_64-portbld-freebsd13.0/8.2.0/include/x86intrin.h

Even when forcing to find it by creating symlink compilatin fails because a bunch of intrinsics are not declared.


#2
Hopefully fixed soon:
<URL:https://github.com/project-trident/trident-build/commit/f12dffb9bc5fcbd2079fadccea0c72bf9078e430>
John
groenveld@acm.org

#3

The head which I am trying to build is on this commit as shown above: 7f15c5c73affe2c701ff2b763064e60b791e2c3a

Does anyone know what pkg is missing so that www/chromium build succeeds?


#4

@beanpole135 went through the commit log. Nothing shows up. he did a port sync, and a build is doing it’s thing.

time will tell


#5

Sorry, I was looking at trueos-master where the referenced above commit is there but not on trueos-stable-18.12


#6

Glad someone else pointed this out. I noticed it when I installed the OS last week myself.


#7
<URL:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220103>
John
groenveld@acm.org

#9

Thanks for referencing this!

I commented there to request re-opening the bug since resolution is clearly not reached yet…


#10
I've tried relinking devel/glib20 with GNU ld instead of lld but still the environ
symbol is not found.

Very weird bug, the symbol should be part of libc and its here:
$ ldd /usr/local/lib/libglib-2.0.so
/usr/local/lib/libglib-2.0.so:
        libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x800e00000)
        libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x800efe000)
        libthr.so.3 => /lib/libthr.so.3 (0x800fa0000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x8007dd000)
        libc.so.7 => /lib/libc.so.7 (0x800249000)

John
groenveld@acm.org

#11

Yes, as the first test I did to verify the clib is complete I compiled, linked and ran the following successfully:

I rebuilt and reinstalled devel/glib2.0 as well but it didn’t help.

I could not rebuild www/chromium because of stumbling into “x86intrin.h not found” compilation error.

#include <stdio.h>
#include <stddef.h>

extern char** environ;

int main(int argc, char *argv[])
{
int count = 0;

printf("\n");
while(environ[count] != NULL)

{
printf("[%s] :: ", environ[count]);
count++;
}

return 0;
}

[ ~] cc test_env.c [~] ./a.out

[LC_ALL=en_US.UTF-8] …

ldconfig output

[~]$ sudo ldconfig -r|grep glib
164:-lpyglib-2.0-python2.7.0 => /usr/local/lib/libpyglib-2.0-python2.7.so.0
186:-ljson-glib-1.0.0 => /usr/local/lib/libjson-glib-1.0.so.0
395:-lglib-2.0.0 => /usr/local/lib/libglib-2.0.so.0
439:-ldbus-glib-1.2 => /usr/local/lib/libdbus-glib-1.so.2
554:-lavahi-glib.1 => /usr/local/lib/libavahi-glib.so.1
726:-lpulse-mainloop-glib.0 => /usr/local/lib/libpulse-mainloop-glib.so.0
765:-lpoppler-glib.8 => /usr/local/lib/libpoppler-glib.so.8

[ ~]$ sudo ldconfig -r|grep “libc.so”
33:-lc.7 => /lib/libc.so.7


#12
I'm able build chromium-68.0.3440.106_7 from ports under 
18.12-PRERELEASE2.

# pkg install `pkg rquery '%o %n' | grep ^base | grep development | awk '{print $2}'
# compiler-bootstrap llvm60
# cd /usr/ports; git log|head -3
git log | head -3
commit 7f15c5c73affe2c701ff2b763064e60b791e2c3a
Author: Kris Moore <kris@pcbsd.org>
Date:   Sun Dec 30 15:53:21 2018 -0500

John
groenveld@acm.org

#13

I have those and yet:

[~]$ sudo pkg install pkg rquery '%o %n' | grep ^base | grep development | awk '{print $2}'
Updating Trident repository catalogue…
Trident repository is up to date.
All repositories are up to date.
Checking integrity… done (0 conflicting)
The most recent version of packages are already installed

In file included from …/…/third_party/angle/src/common/string_utils.cpp:18:
…/…/third_party/angle/src/common/platform.h:91:10: fatal error: ‘x86intrin.h’ file not found
#include <x86intrin.h>
^~~~~~~~~~~~~


#14
# find /usr/ -name x86intrin.h
/usr/local/llvm70/lib/clang/7.0.0/include/x86intrin.h
/usr/local/llvm60/lib/clang/6.0.1/include/x86intrin.h
/usr/src/contrib/llvm/tools/clang/lib/Headers/x86intrin.h
/usr/src/trueos/contrib/llvm/tools/clang/lib/Headers/x86intrin.h
/usr/ports/www/chromium/work/chromium-68.0.3440.106/third_party/llvm/tools/clang/lib/Headers/x86intrin.h
/usr/lib/clang/7.0.1/include/x86intrin.h

# pkg install llvm60 llvm70

John
groenveld@acm.org

#15

llvm60 is there but llvm70 is missing

[~]] sudo pkg install llvm60 Updating Trident repository catalogue... Trident repository is up to date. All repositories are up to date. Checking integrity... done (0 conflicting) The most recent version of packages are already installed [~] sudo pkg install llvm70
Updating Trident repository catalogue…
Trident repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
llvm70: 7.0.0_1

Number of packages to be installed: 1

The process will require 875 MiB more space.
167 MiB to be downloaded.

It is not that.

This is suspiciously empty:

ls -lrt /usr/lib/clang/6.0.1/include/
total 1
drwxr-xr-x 2 root wheel 2 Dec 30 21:04 sanitizer

How did you install 18.12 prelease 2?
I did a simple trueos-update upgrade and watched it happen. Did you do anything else as post-upgrade step?
(because sounds like something was not fully installed after upgrade)


#16

ok , I was able to proceed with builld by doing compiler-bootstrap llvm70
apparently clang was upgraded to 7.0.1 but was not switched to on the system


#17
The devs may be at llvm70:

# pkg which /usr/lib/clang/7.0.1/include/x86intrin.h
/usr/lib/clang/7.0.1/include/x86intrin.h was installed by package OS-runtime-development-13.0.20181219130325
# compiler-bootstrap llvm70
# cc -v
clang version 7.0.0 (tags/RELEASE_700/final)
Target: x86_64-portbld-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin

John
groenveld@acm.org

#18

Looking at compiler-bootstrap i see default is llvm60 but clang/6.0.1/include looks purged after upgrade . I guess script should default to llvm70 if llvm60 is gone.

Script to go through and create sym-links to ports version of LLVM

DEFAULT_LLVM=llvm60

The pull request raised to fix the script:


#19

As for runtime linkage error it seems to be rooted somewhere in how devel/glib20 is built and linked. According to objdump and nm definition for ‘environ’ symbol is not linked in glib2.0.so (shown as UNDF) but it is perfectly in place in a simple printenv test binary.

When I inspected make build log I only see -L/usr/local/lib but no -L/lib which might be suspicious because libc is located in /lib

I added some of these details to the previously referenced FreeBSD bug ticket above


#20
This fugly hack:
# pkg install llvm50
# compiler-bootstrap llvm50
And then relink chrome.
# rm /usr/ports/www/chromium/work/.stage_done.chromium._usr_local
# rm /usr/ports/www/chromium/work/.build_done.chromium._usr_local
# rm /usr/ports/www/chromium/work/.package_done.chromium._usr_local
# touch /usr/ports/www/chromium/work/chromium-68.0.3440.106/out/Release/obj/url/url/url_constants.o
# cd /usr/ports/www/chromium; make package

John
groenveld@acm.org

#21

Compiler / linker downgrade seems risky
When I get home I’ll check out the port linker scripts that were mentioned on FreeBSD bug tracker, whether it is possible to fix those up and make compatible with FreeBSD