Compile Minix on Ubuntu 20.04 LTS

541 views
Skip to first unread message

heitai

unread,
Dec 12, 2020, 3:08:47 PM12/12/20
to min...@googlegroups.com
Hi,

I try to compile my fork : https://github.com/Heitai-C11/MiniX-C11

I use : sh build.sh -U -mi386 -O ../build tools
to compile and have this errors :

=======================================================================
/home/heitai/Documents/MiniX-C11/tools/llvm-
lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/
include/llvm/IR/ValueMap.h: In member function 'bool
llvm::ValueMap<KeyT, ValueT, Config>::hasMD() const':
/home/heitai/Documents/MiniX-C11/tools/llvm-
lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/
include/llvm/IR/ValueMap.h:104:31: error: cannot convert 'const
std::unique_ptr<llvm::DenseMap<const llvm::Metadata*,
llvm::TrackingMDRef> >' to 'bool' in return
104 | bool hasMD() const { return MDMap; }
| ^~~~~
| |
| const
std::unique_ptr<llvm::DenseMap<const llvm::Metadata*,
llvm::TrackingMDRef> >
/home/heitai/Documents/MiniX-C11/tools/llvm-
lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/
lib/CodeGen/CodeGenPrepare.cpp: In constructor
'{anonymous}::CodeGenPrepare::CodeGenPrepare(const
llvm::TargetMachine*)':
/home/heitai/Documents/MiniX-C11/tools/llvm-
lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/
lib/CodeGen/CodeGenPrepare.cpp:150:62: error: call of overloaded
'ValueMap()' is ambiguous
150 | : FunctionPass(ID), TM(TM), TLI(nullptr), TTI(nullptr)
{
| ^
In file included from /home/heitai/Documents/MiniX-C11/tools/llvm-
lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/
lib/CodeGen/CodeGenPrepare.cpp:36:
/home/heitai/Documents/MiniX-C11/tools/llvm-
lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/
include/llvm/IR/ValueMap.h:102:3: note: candidate:
'llvm::ValueMap<KeyT, ValueT, Config>::ValueMap() [with KeyT =
llvm::Value*; ValueT = llvm::Value*; Config =
llvm::ValueMapConfig<llvm::Value*, llvm::sys::SmartMutex<false> >]'
102 | ValueMap() {}
| ^~~~~~~~
/home/heitai/Documents/MiniX-C11/tools/llvm-
lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/
include/llvm/IR/ValueMap.h:97:12: note: candidate:
'llvm::ValueMap<KeyT, ValueT, Config>::ValueMap(unsigned int) [with
KeyT = llvm::Value*; ValueT = llvm::Value*; Config =
llvm::ValueMapConfig<llvm::Value*, llvm::sys::SmartMutex<false> >]'
97 | explicit ValueMap(unsigned NumInitBuckets = 64)
| ^~~~~~~~

*** Failed target: CodeGenPrepare.lo


=======================================================================
102 /// what do ValueMap()
103 ValueMap() {}
104
105 bool hasMD() const { return MDMap; }
106 MDMapT &MD() {
107 if (!MDMap)
108 MDMap.reset(new MDMapT);
109 return *MDMap;
110 }
=======================================================================

Can you help me to arrive to test my forx and compile IT.

Best Regard,
Heitai.
--



Paul Walker

unread,
Dec 13, 2020, 10:28:35 AM12/13/20
to min...@googlegroups.com, heitai
Hi

See if
https://github.com/Stichting-MINIX-Research-Foundation/minix/pull/310
helps - it's a problem that's been around for a while but I'm not sure
anyone's still making commits to the main Minix repo.

Paul
--
Paul

heitai

unread,
Dec 13, 2020, 2:59:34 PM12/13/20
to Paul Walker, min...@googlegroups.com
Hi, and thanks a lot for your help. seems resolv the problem but another bug appar :P

/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/lib/CodeGen/CodeGenPrepare.cpp:150:62: error: call of overloaded 'ValueMap()' is ambiguous
  150 |         : FunctionPass(ID), TM(TM), TLI(nullptr), TTI(nullptr) {
      | 



147   public:
 148     static char ID; // Pass identification, replacement for typeid
 149     explicit CodeGenPrepare(const TargetMachine *TM = nullptr)
 150         : FunctionPass(ID), TM(TM), TLI(nullptr), TTI(nullptr) {
 151         initializeCodeGenPreparePass(*PassRegistry::getPassRegistry());
 152       }
 153     bool runOnFunction(Function &F) override;
 154 
 155     const char *getPassName() const override { return "CodeGen Prepare"; }
 156 
 157     void getAnalysisUsage(AnalysisUsage &AU) const override {
 158       AU.addPreserved<DominatorTreeWrapperPass>();
 159       AU.addRequired<TargetLibraryInfo>();
 160       AU.addRequired<TargetTransformInfo>();
 161     }



mv CodeGen.lo.o CodeGen.lo
#   compile  libLLVMCodeGen/CodeGenPrepare.lo
c++ -O -O2 -fno-rtti -fno-exceptions  -I. -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/clang/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/lld/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/mclinker/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/lldb/include -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCLANG_ENABLE_STATIC_ANALYZER -I/home/heitai/Documents/MiniX-C11/../build/tools/llvm-include -I/home/heitai/Documents/MiniX-C11/../build/tools/llvm/config/include -I/home/heitai/Documents/MiniX-C11/../build/tools/llvm/config/tools/clang/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../config/mclinker -std=c++11 -std=c++11 -c -o CodeGenPrepare.lo.o    /home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/lib/CodeGen/CodeGenPrepare.cpp
/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/lib/CodeGen/CodeGenPrepare.cpp: In constructor '{anonymous}::CodeGenPrepare::CodeGenPrepare(const llvm::TargetMachine*)':
/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/lib/CodeGen/CodeGenPrepare.cpp:150:62: error: call of overloaded 'ValueMap()' is ambiguous
  150 |         : FunctionPass(ID), TM(TM), TLI(nullptr), TTI(nullptr) {
      |                                                              ^
In file included from /home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/lib/CodeGen/CodeGenPrepare.cpp:36:
/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/include/llvm/IR/ValueMap.h:103:3: note: candidate: 'llvm::ValueMap<KeyT, ValueT, Config>::ValueMap() [with KeyT = llvm::Value*; ValueT = llvm::Value*; Config = llvm::ValueMapConfig<llvm::Value*, llvm::sys::SmartMutex<false> >]'
  103 |   ValueMap() {}
      |   ^~~~~~~~
/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/include/llvm/IR/ValueMap.h:97:12: note: candidate: 'llvm::ValueMap<KeyT, ValueT, Config>::ValueMap(unsigned int) [with KeyT = llvm::Value*; ValueT = llvm::Value*; Config = llvm::ValueMapConfig<llvm::Value*, llvm::sys::SmartMutex<false> >]'
   97 |   explicit ValueMap(unsigned NumInitBuckets = 64)
      |            ^~~~~~~~

*** Failed target:  CodeGenPrepare.lo
*** Failed command: c++ -O -O2 -fno-rtti -fno-exceptions -I. -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/clang/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/lld/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/mclinker/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/lldb/include -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCLANG_ENABLE_STATIC_ANALYZER -I/home/heitai/Documents/MiniX-C11/../build/tools/llvm-include -I/home/heitai/Documents/MiniX-C11/../build/tools/llvm/config/include -I/home/heitai/Documents/MiniX-C11/../build/tools/llvm/config/tools/clang/include -I/home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../config/mclinker -std=c++11 -std=c++11 -c -o CodeGenPrepare.lo.o /home/heitai/Documents/MiniX-C11/tools/llvm-lib/libLLVMCodeGen/../../llvm/../../external/bsd/llvm/lib/../dist/llvm/lib/CodeGen/CodeGenPrepare.cpp
*** Error code 1



Thanks for your help,
be happy,
Heitai...
--
[..]

test 123

unread,
Feb 26, 2021, 3:06:08 PM2/26/21
to minix3
Maybe this helps. This allows me to create builds of minix. See Cross-building for x86

On ubuntu 20.04 install gnu compilers version 7, and set them as default compilers:
$ sudo apt -y install gcc-7 g++-7
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7

See if build works. 

Op zondag 13 december 2020 om 20:59:34 UTC+1 schreef hei...@minix-c11.org:

heitai

unread,
Mar 20, 2021, 2:44:34 PM3/20/21
to min...@googlegroups.com
Hi,

Thanks for your reply. I will try
--
You received this message because you are subscribed to the Google Groups "minix3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minix3/54d7b821-7e5a-4283-94b9-d1602eb6b6f3n%40googlegroups.com.

stux...@gmail.com

unread,
Mar 24, 2021, 6:28:12 AM3/24/21
to minix3
Hi everybody,

I've created an issue to start tracking gcc compilation issues:
Heitai: please let us know if the gcc-7 instructions above helped resolve your issue.

Thanks,
-stux

heitai seishin

unread,
Mar 24, 2021, 6:30:07 AM3/24/21
to min...@googlegroups.com
Okay

--
You received this message because you are subscribed to the Google Groups "minix3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages