dicej / android-libcore64 Goto Github PK
View Code? Open in Web Editor NEWfork of https://android.googlesource.com/platform/libcore to make it 64-bit safe
fork of https://android.googlesource.com/platform/libcore to make it 64-bit safe
The file java_text_Bidi.cpp
can't be built with clang because of a MACRO error in icu4c.
The complete error is:
\android\libcore\luni\src\main\native\java_text_Bidi.cpp:9
2:5: error:
no matching function for call to 'ubidi_setPara_51'
ubidi_setPara(data->uBiDi(), chars.get(), length, paraLevel, data->embeddingLevels(), &err);
^~~~~~~~~~~~~
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/urename.h:466:23: note:
expanded from macro 'ubidi_setPara'
#define ubidi_setPara U_ICU_ENTRY_POINT_RENAME(ubidi_setPara)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/uvernum.h:114:40: note:
expanded from macro 'U_ICU_ENTRY_POINT_RENAME'
#define U_ICU_ENTRY_POINT_RENAME(x) U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/uvernum.h:113:44: note:
expanded from macro 'U_DEF2_ICU_ENTRY_POINT_RENAME'
#define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/uvernum.h:112:43: note:
expanded from macro 'U_DEF_ICU_ENTRY_POINT_RENAME'
#define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
^~~~~~
<scratch space>:196:1: note: expanded from here
ubidi_setPara_51
^~~~~~~~~~~~~~~~
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/ubidi.h:1217:1: note:
candidate function not viable: no known conversion from 'const jchar *' (aka 'const unsigned short *') to
'const UChar *' (aka 'const wchar_t *') for 2nd argument
ubidi_setPara(UBiDi *pBiDi, const UChar *text, int32_t length,
^
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/urename.h:466:23: note:
expanded from macro 'ubidi_setPara'
#define ubidi_setPara U_ICU_ENTRY_POINT_RENAME(ubidi_setPara)
^
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/uvernum.h:114:40: note:
expanded from macro 'U_ICU_ENTRY_POINT_RENAME'
#define U_ICU_ENTRY_POINT_RENAME(x) U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
^
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/uvernum.h:113:44: note:
expanded from macro 'U_DEF2_ICU_ENTRY_POINT_RENAME'
#define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
^
\android\libcore\luni\src\main\native\..\..\..\..\..\exter
nal\icu4c\common\unicode/uvernum.h:112:43: note:
expanded from macro 'U_DEF_ICU_ENTRY_POINT_RENAME'
#define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
^
<scratch space>:165:1: note: expanded from here
ubidi_setPara_51
^
Note : the file is built correctly with gcc.
Note: icu4c is successfully built with clang.
Please, take a look into this citation from java.io.File class:
/**
* Indicates if this file's pathname is absolute. Whether a pathname is
* absolute is platform specific. On Android, absolute paths start with
* the character '/'.
*
* @return {@code true} if this file's pathname is absolute, {@code false}
* otherwise.
* @see #getPath
*/
public boolean isAbsolute() {
return path.length() > 0 && path.charAt(0) == separatorChar;
}
On POSIX systems this works well, cause absolute paths start from "/". But on Windows we have a problem with drive letter.
That leads to losing the "absolute path" state for all the paths and prepending the base again to them like this:
C:\myprogram\path\C:\other\path\filename.ext
This could be solved easily, but we have a global problem here - how we should solve such problems?
We could:
public static final boolean IS_WINDOWS = false;
and set it to true in the native Posix.init()
function on Windows. Here we check it and decide the algorithm for absolute paths.
2. Make a patch for File.java in Avian and don't touch Android code at all
3. Your variant
This problem is the most noticeable one for now cause you can't even use FileInputReader or any other IO routine with absolute paths - all of them are broken.
Please, tell us your opinion.
Hello,
I'm trying to build luni on windows and I get error in java_io_console.java
regarding termios
.
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
37:5: error:
unknown type name 'termios'
termios state;
^
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
38:61: error:
invalid operands to binary expression ('void' and 'int')
if (TEMP_FAILURE_RETRY(tcgetattr(STDIN_FILENO, &state)) == -1) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
46:28: error:
use of undeclared identifier 'ECHO'
state.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
46:35: error:
use of undeclared identifier 'ECHOE'
state.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
46:43: error:
use of undeclared identifier 'ECHOK'
state.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
46:51: error:
use of undeclared identifier 'ECHONL'
state.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
48:52: error:
use of undeclared identifier 'TCSAFLUSH'
if (TEMP_FAILURE_RETRY(tcsetattr(STDIN_FILENO, TCSAFLUSH, &state)) == -1){
^
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libnativehelper\include\nativehelper\JNIHelp.h:20
0:13: note:
expanded from macro 'TEMP_FAILURE_RETRY'
typeof (exp) _rc; \
^
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
48:52: error:
use of undeclared identifier 'TCSAFLUSH'
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libnativehelper\include\nativehelper\JNIHelp.h:20
2:16: note:
expanded from macro 'TEMP_FAILURE_RETRY'
_rc = (exp); \
^
C:\Users\cran\Dropbox\docs\projects\github\robovm\robovm\vm\rt\android\libcore\luni\src\main\native\java_io_Console.cpp:
48:72: error:
invalid operands to binary expression ('void' and 'int')
if (TEMP_FAILURE_RETRY(tcsetattr(STDIN_FILENO, TCSAFLUSH, &state)) == -1){
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
Any idea how to fix that ?
Hello,
I have an issue while I'm trying to build the luni component with the file IcuUtilities.cpp
jobjectArray fromStringEnumeration(JNIEnv* env, StringEnumeration* se) {
UniquePtr<StringEnumeration> deleter(se);
if (se == NULL) {
return NULL;
}
UErrorCode status = U_ZERO_ERROR;
int32_t count = se->count(status);
if (maybeThrowIcuException(env, "StringEnumeration::count", status)) {
return NULL;
}
jobjectArray result = env->NewObjectArray(count, JniConstants::stringClass, NULL);
for (int32_t i = 0; i < count; ++i) {
const UnicodeString* string = se->snext(status);
if (maybeThrowIcuException(env, "StringEnumeration::snext", status)) {
return NULL;
}
// Error here:
// cannot initialize a parameter of type 'const jchar *' (aka 'const unsigned short *')
// with an rvalue of type 'const UChar *' (aka 'const wchar_t *')
ScopedLocalRef<jstring> javaString(env, env->NewString(string->getBuffer(), string->length()));
env->SetObjectArrayElement(result, i, javaString.get());
}
return result;
}
It seems there is some conversion issue here.
What should I do?
A basic cast? Or convert the string into the expected type?
I wanted to put this one into Avian repo, but it's not strictly connected to Avian, but to our Android classpath.
I have a problem.
I am fixing the https connections. To do so I updated some openssl code and NativeCrypto. And then I've found a strange thing. The headers being used in Avian upstream for Android are pointing to Android version of OpenSSL, that leads to some errors due to slightly different compiler definitions. For example, if I try to execute this:
import java.math.BigInteger;
public class test
{
public static void main(String... args)
{
BigInteger b = new BigInteger("18593836528167530166073666026719346417823020176439626614028413526404999880327491506516272499878595030280607624081438145719716642109530242659974572679669677548979696293574077291727192086389317945295581875611100688257077150290313913955933994627422464025892853888864897311552582747029009460312175941403825512521608234592729773874485778822321589754921410345863648258311304381933433700800812808227503479049701935651549507766659090195540832938734819645038439964149513414251203390539403371826169388236059881359107837063445950264136412956956189058996444497800605449275501685458800039488567279669997212084742578387973641915947");
System.out.println(b.toString() + "\n" + b.bitLength());
}
}
I receive an incorrect length value.
I have changed includes to the proper ones - taken from the upstream version and got an ugly problem. Avian compiles fine and starts, but if I try to run any program that uses OpenSSL in any way (like the example above), Avian just crashes. This problem is eproduced only in MinGW (OSX works brilliant).
Did you leave the incorrect includes intentionally for some cause? Or it was just a mistake?
Do you have any ideas about how to fix that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.