Jump to content

C++ proposition


Jief_Machak
 Share

823 posts in this topic

Recommended Posts

1 minute ago, Slice said:

How to compile mtoc.NEW_jief?

It's automatically called by ebuild.sh

 

To do it manually "source edksetup.sh" that'll define WORKSPACE env var.

I'm not sure what Xcode does with indexes. Maybe quit xcode, delete the derived folder ?

Delete the other ProcessorBind.h ?

 

My xcode never did that, so I never had to fix it.

Xcode 10.1 on High Sierra.

Link to comment
Share on other sites

1 minute ago, Jief_Machak said:

It's automatically called by ebuild.sh

 

To do it manually "source edksetup.sh" that'll define WORKSPACE env var.

Not called. It checked I already have some mtoc.

Thanks, now I got it.

But build button in CloverX64 project don't make the result

edk2prefix=../..
component_path=rEFIt_UEFI/refit
edk2project=Clover
edk2libname=CLOVERX64.lib
outputname=./DerivedData/clang-slink/CloverX64
/Users/sergey/src/Clover/Xcode/CloverX64/clang-slink: line 69: ../../../../toolchain/bin/mtoc.NEW_jief: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

 

-  cctools-921 extract...

-  cctools-921 make mtoc...

-  cctools-921 installing mtoc...

-  cctools-921 mtoc installed in /Users/sergey/src/opt/local

 

It is already here!

 

Снимок экрана 2020-04-19 в 21.28.18.png

Link to comment
Share on other sites

OK, now your CloverX64 build is succeeded.

I have to correct clang-slink

[[ $? == 0 ]] && "$edk2prefix"/../opt/local/bin/mtoc.NEW_jief -subsystem UEFI_APPLICATION  -align 0x20 ./"$outputname".dll ./"$outputname".pecoff
 

Why you have other path?

Link to comment
Share on other sites

buildmtoc is called line 226 of of ebuild.sh

 

in my script "clang-slink", I call this mtoc with a path to where I put my toolchain. So this is not generic. So the problem is "how this script can generically find the toolchain folder ?"

I'll have a look tomorrow.

So at least, no warning at compilation ?

Link to comment
Share on other sites

You can commit. But I still need a better way because hard coding /opt/local/bin is no better that me hard coding 

"$edk2prefix"/../../toolchain/bin/mtoc.NEW_jief
I'll think about it.
In the mean time, it's ok.
 
Do you compile with no printf warnings with this project ?
Link to comment
Share on other sites

4 minutes ago, Jief_Machak said:

You can commit. But I still need a better way because hard coding /opt/local/bin is no better that me hard coding 

"$edk2prefix"/../../toolchain/bin/mtoc.NEW_jief
I'll think about it.
In the mean time, it's ok.
 
Do you compile with no printf warnings with this project ?

Снимок экрана 2020-04-19 в 21.44.50.png

Link to comment
Share on other sites

No printf warning !

I guess the recommended settings is because you have a more recent xcode. Don't know what will happen if you update and I reopen on my older xcode. We can try.

 

The warning about debug symbol, can it be disabled in the xcode warning list ?

Link to comment
Share on other sites

Testing again with Visual Studio 2019 (toolset VS2017)

c:\users\sergey\desktop\work\clover\rEFIt_UEFI\cpp_foundation\unicode_conversions.h(21): fatal error C1189: #error:  __WCHAR_MAX__

It seems the variable is undefined in VS.

Set to 0xFFFF?

Link to comment
Share on other sites

2 hours ago, Jief_Machak said:

Currently yes, but it can change. That's why I think "#define __WCHAR_MAX__ WCHAR_MAX" is better, don't you think ?

Agree

Link to comment
Share on other sites

VS compilation works!

44:710  0:000  Starting Clover revision: 5113 on CLOVER EFI
44:710  0:000  Build with: [Command: "cbuild.bat" | OS: Win 10.0.14393]

Link to comment
Share on other sites

Right. 

 

I also commented out

  if (FilmC == nullptr) {

//    DBG("Screen %lld inited without anime\n", ID);

//    FilmC->AnimeRun = FALSE;

    return;

  }

that will cause crashes with anime

 

  • Like 1
Link to comment
Share on other sites

I've committed a new implementation of XString.

It mostly works like before (good news :)).

 

What's new is that all the operation are done as if the string were UTF32. If you string is "Выход", length() will return 5 whatever is a XString or XStringW (which can be XString16 or XString32 depending of wchar compilation option).

The [] operator, char32At, char16At also use a "logical" index that is the nth utf32 char in the string, even if the memory representation is utf8 16 or 32.

The comparison operator works also independently of the physical encoding. ie a XString containing "Выход" will be equal to a XStringW containing "Выход"

 

there is a s(), c_str() and wc_str() method that return the same : the first char of the string with a native type (char or wchar_t), suitable to give to printf or EFI API functions.

 

There is a sizeInBytes() method. Remember to divide by sizeof(wchar_t) if you need the number of char of a XStringW. A method named like sizeInWchar() can be created.

size() is removed to avoid confusion. If you need size(), there's probably something wrong, except if few rare cases.

If you want to supply a XStringW to a EFI function as an OUT paramter (EFI function will write data), use dataSized(size) <- size in nb of char or wchar_t, NOT in bytes.

 

The operator with litteral ( like XString a = "aa" ) are still deactivated for now, but the _XS and _XSW are still there. So XString a = "aa"_XS works.

 

Oups, bug in refit.inf. Doing it now.

  • Like 2
Link to comment
Share on other sites

I tried VS compilation and I have an error "unresolved external symbol __chkstk".

 

Someone said use compiler option -Zl Omit default library name in object files.
or linker option -nodefaultlib Ignore standard places.

 

Can you compile it ? Or do you get the same ?

 

Link to comment
Share on other sites

3 hours ago, Jief_Machak said:

I tried VS compilation and I have an error "unresolved external symbol __chkstk".

 

Someone said use compiler option -Zl Omit default library name in object files.
or linker option -nodefaultlib Ignore standard places.

 

Can you compile it ? Or do you get the same ?

 

I have no such problem.

-> "boot1xalt"

### Build dir: "C:\Users\Sergey\Desktop\Work\Clover\Build\Clover\RELEASE_VS2017"
### EFI dir: "C:\Users\Sergey\Desktop\Work\Clover\CloverPackage\CloverV2\EFI"

Done!
PS C:\Users\Sergey\Desktop\Work\Clover>

My environment:

1. Clean Windows 10 Pro. 

2. VS 2019 Community with several options (C++, CLI). And with v141 toolset needed for me for other reason. But v141 == VS2017 toolset.

3. As well I need SDK for Windows 10.0.17763.0 and I have to copy headers

. Copy folder C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\atlmfc 
to folder
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.16.27023\
Not sure if this is related.

4. Latest NASM. 2.14.02

5. Latest Git.

6. Make Windows Power Shell to see Nasm and git.

7. Cd to Clover folder and type

edksetup.bat Rebuild

cbuild.bat

Link to comment
Share on other sites

 Share

×
×
  • Create New...