개발 환경 설정을 한후에, 예전에 Intel기반의 Macbook Pro 2013 Late에서 설정했던 LODE를 이용하여 빌드 환경을 설정하였습니다. https://wiki.documentfoundation.org/Development/lode 빌드 환경 설정이 완료되어서 core (LibreOffice의 빌드 소스) 디렉토리로 이동하여, 다음의 명령어로 빌드를 실행하였습니다.
configure: error: in `/Users/sungdaehyun/dev/lode/dev/core':
configure: error: online update or breakpad/crashreporting are enabled, but no --with-privacy-policy-url=... was provided
해당 이슈에 대해서 왜 나오는지 이유를 알 수 없어, 내용을 IRC로 문의를 하니 다음과 같은 답변을 받았습니다.
10:25 PM <dhsung> Hello
10:25 PM <dhsung> Today, I bought new Apple M1 MacbookAir. So, I prepare autogen option for build. But, I found the message "online update or breakpad/crashreporting are enabled, but no --with-privacy-policy-url=... was provided" What is mean?
10:26 PM <mst___> either disable those features or use an arbitrary value for the url, it's just shown in a dialog somewhere
To build, run:
/Users/****/dev/lode/opt/bin/make
To view some help, run:
/Users/****/dev/lode/opt/bin/make help
After the build has finished successfully, you can immediately run what you built using the command:
open instdir/LibreOfficeDev.app
If you want to run the smoketest, run:
/Users/****/dev/lode/opt/bin/make check
HOST config (config.warn)
*************************************
* WARNING : Cannot find Clang headers to build compiler plugins, plugins disabled.
이후에 make로 빌드를 실행하였습니다.
Apple M1에서 빌드가 완료되고, 다음과 같이 빌드 완료된 프로그램 실행을 해보았습니다.
open instdir/LibreOfficeDev.app
실행이 아주 잘됩니다!
여기까지, Apple M1에서 LibreOffice(리브레오피스) 빌드 및 실행해보기 기록이였습니다.
빌드 중 에러, Skia는 Clang(llvm)이 필요하나 현재 cygwin에서 설치를 했으나 인식을 못하는듯 그래서 빌드시 skia 미지원으로 빌드하도록 변경
checking whether to build Skia... yes checking for clang-cl... no configure: error: Clang compiler not found. The Skia library needs to be built using Clang. Error running configure at /cygdrive/c/sources/libo-core/autogen.sh line 299.
안티바이러스 끄기를 해야 빌드 설정이 진행되더군요.
cat: 'C:/sources/libo-core/eicar': Permission denied configure: error: Exclude the build and source directories associated with LibreOffice in the following Antivirus software: *Windows Defender Error running configure at /cygdrive/c/sources/libo-core/autogen.sh line 299. Windows10에서 안티바이러스 끄기는 업데이트 및 보안선택 -> Windows 보안선택 -> 바이러스 및 위협방지 클릭
실시간 감지를 끕니다. 그래야 빌드를 시도할 수 있습니다.
빌드 설정이 끝나면 아래와 같은 메세지를 확인할 수 있습니다.
To build, run:
C:/cygwin64/opt/lo/bin/make
To view some help, run:
C:/cygwin64/opt/lo/bin/make help
이제, 아래의 명령어로 빌드를 진행해봅니다
$ /opt/lo/bin/make clean gb_COLOR=1
이후, 빌드를 하려니 또 오류가 나오더군요.
아래 오류를 보니, 왜 빌드가 안되지 하며 이해가 안되어 머리가 아팠습니다. msvcprtd.lib(MSVCP100D.dll) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
위의 빌드 오류 이슈에 대해서 LibreOffice의 #libreoffice-dev채널에서 아래의 링크를 이용하여 문의를 하였습니다.
Friday, June 12th, 2020 Hello
12:30 AM I have a question for windows build.
12:31 AM Now, I build LibreOffice on Windows. After setting building environment (Cygwin). During building, It shows error message
12:31 AM [coreconf/rules.mk:44: lib] Error 2
12:31 AM out\nssutil3.lib □□□̺귯□□ □□ out\nssutil3.exp
12:32 AM [C:/sources/libo-core/external/nss/ExternalProject_nss.mk:21: C:/build/workdir/ExternalProject/nss/build] Error 1 mst___: please use pastebin
mst___: it looks like when building nss, /FS parameter is missing in the command line for pkix_pl_pk11certstore.c dhsung: Hmm, How to add the /FS parameter at autogen.sh? mst___: can you pastebin the command line that invokes cl.exe on pkix_pl_pk11certstore.c ? https://pastebin.com/nSx0sKkw
mst___: ah... probably the cause is the syntax error in /usr/bin/sh: -c: line 0: `expr Microsoft(R) \> 1600 \| Microsoft(R) = 1600 \& C/C++ \>= 40219'
dhsung: hmm, I checked the env, It shows LANG=ko_KR.UTF-8@cjknarrow
mikekaganski: out of interest: what does 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe' output for you in the console?
1:21 AM you might want to file a bug against NSS with that information ;-)
1:21 AM — mikekaganski used his path to cl.exe, naturally dhsung_ might need to adjust
— mikekaganski has "Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64" in the first line mikekaganski: anyway, I'd suggest you to re-run VS installer, and only select en-US UI
1:42 AM no need to reinstall
1:42 AM just run its installer and modify install set
1:44 AM dhsung_: https://imgur.com/PnNB7Li https://imgur.com/PnNB7Li
아래 영어에 적힌 내용처럼, cygwin 쉘에서는 인코딩 집합과 맞지 않아 빌드 오류인 경우가 많으니, 리브레오피스를 윈도우환경의 cygwin에서 빌드시, Visual Studio설정을 영어로 된 UI로 설정을 해야 한다고 나와 있습니다. Note: Visual Studio command-line tools use system OEM codepage to output messages to console, when corresponding UI language is installed as part of Visual Studio installation. The OEM codepage on Windows depends on system locale defined using "Language for non-Unicode programs" in intl.cpl applet (description of the setting), and is often incompatible with encoding set in cygwin shell (typically UTF-8). This garbles the output from the tools in the build log. You might want to make sure that you only install English UI when installing Visual Studio to avoid that problem.
In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Headers/Python.h:139:
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Headers/pythonrun.h:142:5: error: 'TAPI' is not defined, evaluates to 0 [-Werror,-Wundef]
#if TAPI
^
[AIN] ooo_images
1 error generated.
/Users/****/dev/lode/dev/core/solenv/gbuild/LinkTarget.mk:239: recipe for target '/Users/****/dev/lode/dev/core/workdir/CObject/pyuno/source/module/pyuno_dlopenwrapper.o' failed
make[1]: *** [/Users/****/dev/lode/dev/core/workdir/CObject/pyuno/source/module/pyuno_dlopenwrapper.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:282: recipe for target 'build' failed
make: *** [build] Error 2
해당 내용에서는 C언어 매크로 TAPI가 정의 안되어서 빌드 에러가 난다는 이야기가 나왔습니다.
해당 내용에 대하여 IRC의 #libreoffice-dev채널에 문의를 하였습니다.
9:28 PM I have a question about build on MacOSX (Catalina 10.15.2)
9:28 PM I get a LibreOffice source from git repository. and try to build, then failed.
9:29 PM message is In file included from ***/dev/core/pyuno/source/module/pyuno_dlopenwrapper.c:22:
9:29 PM In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Headers/Python.h:139:
9:29 PM /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Headers/pythonrun.h:142:5: error: 'TAPI' is not defined, evaluates to 0 [-Werror,-Wundef]
9:30 PM What is "#if TAPI" ?
9:41 PM <mikekaganski> dhsung_: a coincidence: https://ask.libreoffice.org/en/question/223751
9:44 PM <ycao> https://ask.libreoffice.org/en/question/223751/error-tapi-is-not-defined-evaluates-to-0-werror-wundef-while-building-on-macos/
9:44 PM Any tips?
9:44 PM <_rene_> yes, the obvious one
9:44 PM (don't build with -Werror)
9:45 PM and this undefined macro is inside python itself which is clear from the error message... (just that LO bundles python if you let it..)
9:45 PM <mikekaganski> _rene_: the problem is that this looks like our default in LODE
9:46 PM <ycao> How can I build without `-Werror`
9:46 PM Using `lode`
9:46 PM <_rene_> mikekaganski: yes, it's a problem. anywhere :)
9:46 PM $ ./configure --help | grep -i werror --enable-werror Turn warnings to errors. (Has no effect in modules
9:47 PM so --disable-werror, of course ;)
9:48 PM <ycao> So run `./configure --disable-werror` is ok?
9:48 PM <mikekaganski> ycao: essentially, add --disable-werror which _rene_ mentioned to autogen.input in your core directory
빌드 '에러 error'를 에러 대신 '경고 warning'로 바꾸어서 빌드하라고 하더군요.
이유는 TAPI라는 정의되지 않은 매크로는 파이썬 자체에 있고, 이 매크로를 무시해도 빌드 후에 실행은 되니 '에러 error'로 빌드 안되는 것에 대하여 '에러 error'레벨을 '경고 warning'으로 바꾸어서 빌드 하면 된다고 하군요.
그래서, 저는 아래의 명령어로 빌드 진행을 하였습니다.
이후, 빌드 후 확인
****@**** core % ./autogen.sh --with-locales="ko" --with-vendor="DaeHyun Sung, TDF Member" --disable-werror
********************************************************************
*
* Using commandline arguments and ignoring autogen.input!
*
********************************************************************
Running ./configure with '--with-locales=ko --with-vendor=DaeHyun Sung, TDF Member --disable-werror --srcdir=/Users/sungdaehyun/dev/lode/dev/core --enable-option-checking=fatal'
********************************************************************
*
* Running LibreOffice build configuration.
*
********************************************************************
To build, run:
/Users/****/lode/opt/bin/make
To view some help, run:
/Users/****/lode/opt/bin/make help
After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
open instdir/LibreOfficeDev.app
If you want to run the smoketest, run:
/Users/****/lode/opt/bin/make check
****@**** core % make build-nocheck
make -j 4 -rs -f /Users/****/lode/dev/core/Makefile.gbuild build
[PAT] boost
[DEP] LNK:Library/libuno_salhelpergcc3.dylib.3
[LNK] Library/libuno_salhelpergcc3.dylib.3
[UPK] libgpg-error-1.27.tar.bz2
[PAT] icu
[PAT] nss
[PAT] liblangtag
[DEP] LNK:Executable/bestreversemap
[LNK] Executable/bestreversemap
[PAT] libjpeg-turbo
[PAT] lcms2
(생략)
[BIN] extras
[MOD] extras
[MOD] libreoffice
[BIN] top level modules: libreoffice
[ALL] top level modules: build-non-l10n-only build-l10n-only
원래 Arm기반CPU에 탑재되는 Android OS를 X86기반의 CPU에도 작동할수 있게 포팅하는 프로젝트인 Android-x86 프로젝트 사이트(http://www.android-x86.org/)에서 x86기반의 안드로이드 소스(여기서는 Gingerbread)를 받고 난 후 빌드 하였다
make iso_img TARGET_PRODUCT=generic_x86
빌드후에 에러 나는 점을 검색해서 문제 해결한 부분 링크를 붙였다.
결국 빌드는 완료했고 kvm위에서 실행해보았으나 원하는 시험 결과가 나오지 않아 실망했음.
dalvik/vm/native/dalvik_system_Zygote.cpp: In function 'int setrlimitsFromArray(ArrayObject*)': dalvik/vm/native/dalvik_system_Zygote.cpp:194: error: aggregate 'rlimit rlim' has incomplete type and cannot be defined dalvik/vm/native/dalvik_system_Zygote.cpp:217: error: 'setrlimit' was not declared in this scope make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1 make: *** Waiting for unfinished jobs....
CC arch/x86/kernel/ptrace.o /home/dhsung/android-x86/kernel/arch/x86/kernel/ptrace.c:1366:17: error: conflicting types for ‘syscall_trace_enter’ In file included from /home/dhsung/android-x86/kernel/arch/x86/include/asm/vm86.h:130:0, from /home/dhsung/android-x86/kernel/arch/x86/include/asm/processor.h:10, from /home/dhsung/android-x86/kernel/arch/x86/include/asm/thread_info.h:22, from /home/dhsung/android-x86/kernel/include/linux/thread_info.h:53, from /home/dhsung/android-x86/kernel/include/linux/preempt.h:9, from /home/dhsung/android-x86/kernel/include/linux/spinlock.h:50, from /home/dhsung/android-x86/kernel/include/linux/seqlock.h:29, from /home/dhsung/android-x86/kernel/include/linux/time.h:8, from /home/dhsung/android-x86/kernel/include/linux/timex.h:56, from /home/dhsung/android-x86/kernel/include/linux/sched.h:57, from /home/dhsung/android-x86/kernel/arch/x86/kernel/ptrace.c:8: /home/dhsung/android-x86/kernel/arch/x86/include/asm/ptrace.h:146:13: note: previous declaration of ‘syscall_trace_enter’ was here /home/dhsung/android-x86/kernel/arch/x86/kernel/ptrace.c:1411:17: error: conflicting types for ‘syscall_trace_leave’ In file included from /home/dhsung/android-x86/kernel/arch/x86/include/asm/vm86.h:130:0, from /home/dhsung/android-x86/kernel/arch/x86/include/asm/processor.h:10, from /home/dhsung/android-x86/kernel/arch/x86/include/asm/thread_info.h:22, from /home/dhsung/android-x86/kernel/include/linux/thread_info.h:53, from /home/dhsung/android-x86/kernel/include/linux/preempt.h:9, from /home/dhsung/android-x86/kernel/include/linux/spinlock.h:50, from /home/dhsung/android-x86/kernel/include/linux/seqlock.h:29, from /home/dhsung/android-x86/kernel/include/linux/time.h:8, from /home/dhsung/android-x86/kernel/include/linux/timex.h:56, from /home/dhsung/android-x86/kernel/include/linux/sched.h:57, from /home/dhsung/android-x86/kernel/arch/x86/kernel/ptrace.c:8: /home/dhsung/android-x86/kernel/arch/x86/include/asm/ptrace.h:147:13: note: previous declaration of ‘syscall_trace_leave’ was here make[4]: *** [arch/x86/kernel/ptrace.o] 오류 1 make[3]: *** [arch/x86/kernel] 오류 2 make[2]: *** [arch/x86] 오류 2 make[1]: *** [sub-make] 오류 2 make[1]: Leaving directory `/home/dhsung/android-x86/kernel' make: *** [out/target/product/generic_x86/kernel] 오류 2
external/srec/tools/grxmlcompile/grxmlcompile.cpp:938:1: required from here external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:132:9: error: ‘SetState’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:132:9: note: declarations in dependent base ‘fst::VectorFstBaseImpl<fst::CacheState<fst::GallicArc<fst::StdArc, (fst::StringType)0u> > >’ are not found by unqualified lookup external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:132:9: note: use ‘this->SetState’ instead external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: error: ‘SetState’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: note: declarations in dependent base ‘fst::VectorFstBaseImpl<fst::CacheState<fst::GallicArc<fst::StdArc, (fst::StringType)0u> > >’ are not found by unqualified lookup external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: note: use ‘this->SetState’ instead make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] 오류 1
frameworks/base/tools/aapt/AaptAssets.cpp:1386:41: required from here frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptGroup> >’ are not found by unqualified lookup frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead frameworks/base/include/utils/KeyedVector.h: In instantiation of ‘const VALUE& android::DefaultKeyedVector<KEY, VALUE>::valueFor(const KEY&) const [with KEY = android::String8; VALUE = android::sp<AaptDir>]’: frameworks/base/tools/aapt/AaptAssets.cpp:1445:53: required from here frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptDir> >’ are not found by unqualified lookup frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] 오류 1
In file included from dalvik/vm/Dalvik.h:87:0, from dalvik/vm/native/dalvik_system_Zygote.c:20: dalvik/vm/oo/ObjectInlines.h: In function ‘dvmSetObjectArrayElement’: dalvik/vm/oo/ObjectInlines.h:29:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] dalvik/vm/native/dalvik_system_Zygote.c: In function ‘setgroupsIntarray’: dalvik/vm/native/dalvik_system_Zygote.c:172:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] dalvik/vm/native/dalvik_system_Zygote.c: In function ‘setrlimitsFromArray’: dalvik/vm/native/dalvik_system_Zygote.c:192:19: error: storage size of ‘rlim’ isn’t known dalvik/vm/native/dalvik_system_Zygote.c:200:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] dalvik/vm/native/dalvik_system_Zygote.c:204:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] dalvik/vm/native/dalvik_system_Zygote.c:215:9: warning: implicit declaration of function ‘setrlimit’ [-Wimplicit-function-declaration] dalvik/vm/native/dalvik_system_Zygote.c:192:19: warning: unused variable ‘rlim’ [-Wunused-variable] make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] 오류 1
Notice file: system/core/libmincrypt/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//lib/libmincrypt.a.txt Install: out/host/linux-x86/bin/mkbootimg host C: mksdcard <= sdk/emulator/mksdcard/mksdcard.c <command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default] sdk/emulator/mksdcard/mksdcard.c:1:0: note: this is the location of the previous definition host Executable: mksdcard (out/host/linux-x86/obj/EXECUTABLES/mksdcard_intermediates/mksdcard) true Notice file: sdk/emulator/mksdcard/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//bin/mksdcard.txt Install: out/host/linux-x86/bin/mksdcard host Prebuilt: mkuserimg.sh (out/host/linux-x86/obj/EXECUTABLES/mkuserimg.sh_intermediates/mkuserimg.sh) Notice file: system/extras/ext4_utils/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//bin/mkuserimg.sh.txt Install: out/host/linux-x86/bin/mkuserimg.sh host Prebuilt: monkeyrunner (out/host/linux-x86/obj/EXECUTABLES/monkeyrunner_intermediates/monkeyrunner) Install: out/host/linux-x86/bin/monkeyrunner host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp <command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] frameworks/base/tools/obbtool/Main.cpp:1:0: note: this is the location of the previous definition cc1plus: all warnings being treated as errors make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] 오류 1
This happens with commit: a5158b31d97e25832d778a41a31df6ece0fc627e[Ubuntu 11.10 x86_64 running Linux 3.0.0-12-generic]Fix is same build/core/combo/HOST_linux-x86.mk: -HOST_GLOBAL_CFLAGS = -D_FORTIFY_SOURCE=0 HOST_GLOBAL_CFLAGS = -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0[linenumber 59] ------------There are much of: warning: _FORTIFY_SOURCE redefinedBut this frameworks/base/tools/obbtool/Main.cpp is compiled with -Werror
그리고 잠깐 모니터링을 하다, 안드로이드 소스 빌드중 아래와 같은 에러가 발생하고는 빌드가 중단되었습니다 -_-;;
dalvik/vm/native/dalvik_system_Zygote.cpp: In function 'int setrlimitsFromArray(ArrayObject*)': dalvik/vm/native/dalvik_system_Zygote.cpp:194: error: aggregate 'rlimit rlim' has incomplete type and cannot be defined dalvik/vm/native/dalvik_system_Zygote.cpp:217: error: 'setrlimit' was not declared in this scope make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1 make: *** Waiting for unfinished jobs....
<blueguy^> OddEgo / htc 갔더니..
<blueguy^> OddEgo / desire 커널 소스 공개 되어 있더군요.
<OddEgo> 우와
<OddEgo> 커널 소스 공개되어서 xda 분들이 롬을 올리군요... ㅎㄸ
<blueguy^> OddEgo / 이미지 새로 올리는데 만족하지 말고..
<blueguy^> 직접 한번 빌드해서 올려 보는 것이..
<blueguy^> 흐흐.
<OddEgo> virtualbox에 올리면 능력자가 되는건가요?!
<OddEgo> 이미지 새로 올리는데 만족하지 말고.. // 어떻게 정곡을 잘 찌르십니까? ㅎㅎ
<blueguy^> OddEgo / 버박에 올리면 능력자가. 될 듯.
<blueguy^> 흐흐.
<blueguy^> qemu에는 그냥 올릴 수 있어요.
htc에서 공개된 안드로이드 소스코드를 x86용으로 포팅해서 올리면 엄청난 굇수가 되어 있겠지?