# Unable to build libreoffice-3.5.6.2



## G_Nerc (Sep 4, 2012)

Good day! I have a system:
*FreeBSD home FreeBSD 9.0-STABLE #0: Mon Jun 25 03:36:33 MSK 2012     gode@home:/usr/obj/usr/src/sys/SERVER  amd64*
and my /etc/make.conf is

```
CPUTYPE?=athlon64
CFLAGS=-O2 -pipe -msse -msse2 -msse3 -mmmx -m3dnow -mtune=athlon64 -fno-strict-aliasing -Wno-error
COPTFLAGS=-O2 -pipe -msse -msse2 -msse3 -mmmx -m3dnow -mtune=athlon64
TARGET_ARCH=amd64
KERNCONF=SERVER
NO_INET6=true
NO_GAMES=true
NO_I4B=true
```
When I'm trying to build editors/libreoffice it gives me error and talk that I have threaded build (but I not use any make -j2 or MAKE_JOBS_NUMBER=n options)
I'm trying as I found on THAT thread, steps to delete packages [CMD="pkg_delete -f boost-libs\* boost-jam\*"][/CMD] but it doesn't help me. There is errors and additional information:

```
clang++: warning: argument unused during compilation: '-rpath=/usr/lib:/usr/local/lib'
[ build CXX ] svtools/bmpmaker/bmpsum
[ build LNK ] Executable/bmpsum
clang++: warning: argument unused during compilation: '-rpath=/usr/lib:/usr/local/lib'
[ build CXX ] svtools/bmpmaker/g2g
[ build LNK ] Executable/g2g
clang++: warning: argument unused during compilation: '-rpath=/usr/lib:/usr/local/lib'
/usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/solver/unxfbsd.pro/lib/libsvtlo.so: undefined reference to `cppu::WeakAggComponentImplHelper2<com::sun::star::accessibility::XAccessibleContext, com::sun::star::accessibility::XAccessibleEventBroadcaster>::queryAggregation(com::sun::star::uno::Type const&)'
/usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/solver/unxfbsd.pro/lib/libsvtlo.so: undefined reference to `non-virtual thunk to cppu::WeakAggComponentImplHelper2<com::sun::star::accessibility::XAccessibleContext, com::sun::star::accessibility::XAccessibleEventBroadcaster>::queryAggregation(com::sun::star::uno::Type const&)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [/usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/workdir/unxfbsd.pro/LinkTarget/Executable/g2g] ÐžÑˆÐ¸Ð±ÐºÐ° 1
dmake:  Error code 2, while making 'all'

-----------------------------------------------------------------------
        Oh dear - something failed during the build - sorry !
  For more help with debugging build errors, please see the section in:
            http://wiki.documentfoundation.org/Development

  internal build errors:

ERROR: error 65280 occurred while making /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/lingucomponent/source/spellcheck/spell
ERROR: error 65280 occurred while making /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/sdext/source/pdfimport
ERROR: error 65280 occurred while making /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/connectivity/source/drivers/file
ERROR: error 65280 occurred while making /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/svtools/prj

 it seems you are using a threaded build, which means that the
 actual compile error is probably hidden far above, and could be
 inside any of these other modules:
     connectivity lingucomponent svtools
 please re-run build inside each one to isolate the problem.
-----------------------------------------------------------------------

/usr/local/bin/bash
cd /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2
source ./Env.Host.sh
cd sdext
rm -Rf /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/sdext/unxfbsd.pro # optional module 'clean'
build

when the problem is isolated and fixed exit and re-run 'make' from the top-level
gmake[1]: *** [build] ÐžÑˆÐ¸Ð±ÐºÐ° 1
gmake[1]: Ð’Ñ‹Ñ…Ð¾Ð´ Ð¸Ð· ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð° `/usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2'
gmake: *** [source-env-and-recurse] ÐžÑˆÐ¸Ð±ÐºÐ° 2
*** [do-build] Error code 1

Stop in /usr/ports/editors/libreoffice.
*** [install] Error code 1

Stop in /usr/ports/editors/libreoffice.
```
when I'm follow these steps:

```
home# cd work/libreoffice-core-3.5.6.2/
home# /usr/local/bin/bash
[root@home /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2]# source ./Env.Host.sh 
[root@home /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2]# cd sdext/
[root@home /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/sdext]# rm -Rf unxfbsd.pro
[root@home /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/sdext]# build
```
It gives me that error:

```
Making:    pdfparse.lib
Entering /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/sdext/source/pdfimport

Compiling: sdext/unxfbsd.pro/misc/pdfimport.uno_version.c
cp -f description.xml ../../unxfbsd.pro/misc/PDFImport_in/description.xml
/usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/solenv/bin/transform_description.pl: WITH_LANG not set or empty, defaulting to 'en-US'
cp config/pdf_import_filter.xcu ../../unxfbsd.pro/misc/PDFImport/pdf_import_filter.xcu
cp config/pdf_types.xcu ../../unxfbsd.pro/misc/PDFImport/pdf_types.xcu
Compiling: sdext/source/pdfimport/filterdet.cxx
Compiling: sdext/source/pdfimport/pdfiadaptor.cxx
Compiling: sdext/source/pdfimport/services.cxx
Making:    pdfimport.lib
Making:    pdfimport.uno.so
/usr/bin/ld: ../../unxfbsd.pro/slo/filterdet.o: relocation R_X86_64_PC32 against `_ZN3com3sun4star3uno8SequenceIaE7s_pTypeE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
dmake:  Error code 1, while making '../../unxfbsd.pro/lib/pdfimport.uno.so'

-----------------------------------------------------------------------
        Oh dear - something failed during the build - sorry !
  For more help with debugging build errors, please see the section in:
            http://wiki.documentfoundation.org/Development

  internal build errors:

ERROR: error 65280 occurred while making /usr/ports/editors/libreoffice/work/libreoffice-core-3.5.6.2/sdext/source/pdfimport

 it seems that the error is inside 'sdext', please re-run build
 inside this module to isolate the error and/or test your fix:
-----------------------------------------------------------------------
```


----------



## SirDice (Sep 5, 2012)

G_Nerc said:
			
		

> ```
> CFLAGS=-O2 -pipe -msse -msse2 -msse3 -mmmx -m3dnow -mtune=athlon64 -fno-strict-aliasing -Wno-error
> COPTFLAGS=-O2 -pipe -msse -msse2 -msse3 -mmmx -m3dnow -mtune=athlon64
> TARGET_ARCH=amd64
> ```



Remove all this and try again. Don't play around with this unless you know what you are doing.


----------



## G_Nerc (Sep 5, 2012)

SirDice said:
			
		

> Remove all this and try again. Don't play around with this unless you know what you are doing.


Thank you for answer!

I'm comment CFLAGS=... and COPTFLAGS=... but error still exists.
Maybe this line from error output tells something?

```
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
I have not clang in my base system. (I'm rebuild world with option *WITHOUT_CLANG=YES* in /etc/src.conf)
And I have not devel/clang installed from ports:
[CMD=""]ls /var/db/pkg | grep -i clang[/CMD] - gives nothing.

*PS:*
Now I'm try to execute command:
[CMD=""]clang++ --version[/CMD]

```
FreeBSD clang version 3.0 (tags/RELEASE_30/final 145349) 20111210
Target: x86_64-unknown-freebsd9.0
Thread model: posix
```
So I don't know what with clang in my system (because such port not installed and system rebuilds with src.conf)


----------



## SirDice (Sep 6, 2012)

After you rebuild your system did you do

```
make delete-old
make delete-old-libs
```

If you didn't the clang you are seeing is the old one from before the rebuild.


----------



## G_Nerc (Sep 7, 2012)

*SirDice*, yes!
I'm rebuild world (all procedure step by step from /usr/src/Makefile) and editors/libreoffice rebuilds succesfully
But now when I try to start any of application from libreoffice it gives me

```
terminate called after throwing an instance of 'com::sun::star::ucb::InteractiveAugmentedIOException'
```


----------



## Oleg_NYC (Sep 19, 2012)

If I type /usr/local/lib/libreoffice/program/soffice.bin in xterm, I get:

```
Terminating due to uncaught exception 0x812535880 of type com::sun::star::ucb::InteractiveAugmentedIOException
Abort (core dumped)
```

This is libreoffice-3.5.6_1. I run FreeBSD 9.1-prerelease and libreoffice crashes if it's compiled with clang v3.1 or v3.2.


----------



## Oleg_NYC (Sep 19, 2012)

Okay, I fixed this problem by building libreoffice with g++47. According to libreoffice's makefile, that clang-related crash is only supposed to happen on FreeBSD 8.x; however, in my case, it happened on FreeBSD 9.


----------

