solaris

How to solve “fatal: relocations remain against allocatable but non-writable sections” while using Java native interface?

為{幸葍}努か 提交于 2020-01-04 12:48:31
问题 I'm trying to call a C function inside a Java code. I have this hava code. public class JavaToC { public native void helloC(); static { System.loadLibrary("HelloWorld"); } public static void main(String[] args) { new JavaToC().helloC(); } } . I compiled it and then created header file. Then make the following HelloWorld.c file. #include <stdio.h> #include <jni.h> #include "JavaToC.h" JNIEXPORT void JNICALL Java_JavaToC_helloC(JNIEnv *env, jobject javaobj) { printf("Hello World: From C");

How to solve “fatal: relocations remain against allocatable but non-writable sections” while using Java native interface?

眉间皱痕 提交于 2020-01-04 12:47:11
问题 I'm trying to call a C function inside a Java code. I have this hava code. public class JavaToC { public native void helloC(); static { System.loadLibrary("HelloWorld"); } public static void main(String[] args) { new JavaToC().helloC(); } } . I compiled it and then created header file. Then make the following HelloWorld.c file. #include <stdio.h> #include <jni.h> #include "JavaToC.h" JNIEXPORT void JNICALL Java_JavaToC_helloC(JNIEnv *env, jobject javaobj) { printf("Hello World: From C");

C++: Warning (Anachronism) in Solaris Studio when creating a pthread from main using a static function within a class

妖精的绣舞 提交于 2020-01-04 07:20:31
问题 I've been facing this warning. I have a main C++ program which creates several threads. These threads run a function which is in a specific class. In order to do that, this class has a static function which returns the real function I am using to run in these threads. I'll paste the relevant parts of my code for you to understand it better. These are the relevant parts of Car.h, the headers of the class whose function is run in the thread: [...] class Car { public: [...] void *GoForward(void)

Header for _blsr_u64 with Sun supplied GCC on Solaris 11?

柔情痞子 提交于 2020-01-04 05:21:14
问题 We've got some code that runs on multiple platforms. The code uses BMI/BMI2 intrinsics when available, like a Core i7 5th gen. GCC supplied by Sun on Solaris 11.3 is defining __BMI__ and __BMI2__ , but its having trouble locating BMI/BMI2 intrinsics: $ cat test.cxx #include <x86intrin.h> int main(int argc, char* argv[]) { unsigned long long t = argc; #if defined(__BMI__) || defined(__BMI2__) t = _blsr_u64(t); #endif return int(t); } $ /bin/g++ -march=native test.cxx -o test.exe test.cxx: In

Header for _blsr_u64 with Sun supplied GCC on Solaris 11?

梦想与她 提交于 2020-01-04 05:21:08
问题 We've got some code that runs on multiple platforms. The code uses BMI/BMI2 intrinsics when available, like a Core i7 5th gen. GCC supplied by Sun on Solaris 11.3 is defining __BMI__ and __BMI2__ , but its having trouble locating BMI/BMI2 intrinsics: $ cat test.cxx #include <x86intrin.h> int main(int argc, char* argv[]) { unsigned long long t = argc; #if defined(__BMI__) || defined(__BMI2__) t = _blsr_u64(t); #endif return int(t); } $ /bin/g++ -march=native test.cxx -o test.exe test.cxx: In

how can I continously run a unix script in background without using crontab.

徘徊边缘 提交于 2020-01-03 06:32:12
问题 how can I continously run a script in background without using crontab. The script should run even after I logout and is acceptable if it doesen't start after system reboot.I am new to unix. 回答1: There's a couple of ways of doing this but the neatest way is to use screen. This lets you create a session which lives perminently on the machine and you can simply reconnect to to check on the progress of your long running process. If you don't wish to use screen you can use nohup this allows you

linker option to ignore unused dependencies

怎甘沉沦 提交于 2020-01-02 04:34:07
问题 I would like to remove all unused symbols from my compiled C++ binary. I saw this, which gives an overview using gcc, which is the toolchain I'm using: How to remove unused C/C++ symbols with GCC and ld? However, on my system, the linking option ( -Wl,--gc-sections ) is rejected: $ gcc -fdata-sections -ffunction-sections a.c -o a.o -Wl,--gc-sections ld: fatal: unrecognized option '--' ld: fatal: use the -z help option for usage information collect2: error: ld returned 1 exit status I'm

Hide symbol(s) in Shared Object from LD

99封情书 提交于 2020-01-01 05:05:29
问题 I have two third-party libraries occasionally having the same symbol name exported. When the executable is loaded, ld usually picks the wrong one and I getting crash as a result. I cannot do too much about the content of these libraries, so may be there is a way to instruct ld how to find the proper imlementation ? OS - Solaris 10, my program is built by autoconf/autotools/gcc, conflicting libraries are libclntsh (part of Oracle driver) and OpenLDAP. Unfortuinately, I cannot use Oracle's

How to use qemu to run a non-gui OS on the terminal?

风流意气都作罢 提交于 2019-12-31 08:46:32
问题 I want to run some programs on the High Performance Computer (With 8-core processor) in my department. Now I use that machine with ssh using terminal. The machine has Red Hat linux installed on it. But my programs need to run on Solaris. I use Nexenta Solaris for x86. Can qemu be used to run Nexenta Solaris on that machine through terminal. I need to convince the administrator that it can, otherwise he won't install qemu on that machine and therefore allow me to use Solaris through a virtual

Display all fields except the last

試著忘記壹切 提交于 2019-12-30 17:27:10
问题 I have a file as show below 1.2.3.4.ask sanma.nam.sam c.d.b.test I want to remove the last field from each line, the delimiter is . and the number of fields are not constant. Can anybody help me with an awk or sed to find out the solution. I can't use perl here. 回答1: Both these sed and awk solutions work independent of the number of fields. Using sed : $ sed -r 's/(.*)\..*/\1/' file 1.2.3.4 sanma.nam c.d.b Note: -r is the flag for extended regexp, it could be -E so check with man sed . If