fix incorrect EXPORT definition for Windows/x86_64 in boot-javahome.cpp

We should define EXPORT to be __declspec(dllexport) on Windows
regardless of architecture, not just non-x86_64 arches.  This fixes
errors to to embedded JAVA_HOME files not being found in openjdk-src
builds, e.g. lib/currency.data.
This commit is contained in:
Joel Dice 2014-04-09 14:34:22 -06:00
parent f7614bf8a7
commit 8f4ed4dd4f
3 changed files with 9 additions and 42 deletions

View File

@ -8,22 +8,13 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#ifdef _MSC_VER
typedef unsigned char uint8_t;
#else
# include "stdint.h"
#endif
#include "avian/common.h"
#ifdef BOOT_JAVAHOME
#if (! defined __x86_64__) && ((defined __MINGW32__) || (defined _MSC_VER))
# define EXPORT __declspec(dllexport)
# define SYMBOL(x) binary_javahome_jar_##x
#else
# define EXPORT __attribute__ ((visibility("default"))) \
__attribute__ ((used))
# define SYMBOL(x) _binary_javahome_jar_##x
#endif
@ -32,7 +23,7 @@ extern "C" {
extern const uint8_t SYMBOL(start)[];
extern const uint8_t SYMBOL(end)[];
EXPORT const uint8_t*
AVIAN_EXPORT const uint8_t*
javahomeJar(unsigned* size)
{
*size = SYMBOL(end) - SYMBOL(start);

View File

@ -8,29 +8,14 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#include "stdlib.h"
#include <stdlib.h>
#ifdef _MSC_VER
typedef unsigned char uint8_t;
#else // not _MSC_VER
# include "stdint.h"
#include "avian/common.h"
// since we aren't linking against libstdc++, we must implement this
// ourselves:
extern "C" void __cxa_pure_virtual(void) { abort(); }
#endif // not _MSC_VER
#if (defined __MINGW32__) || (defined _MSC_VER)
# define EXPORT __declspec(dllexport)
#else
# define EXPORT __attribute__ ((visibility("default"))) \
__attribute__ ((used))
#endif
#ifdef BOOT_IMAGE
#if (! defined __x86_64__) && ((defined __MINGW32__) || (defined _MSC_VER))
@ -46,7 +31,7 @@ extern "C" {
extern const uint8_t BOOTIMAGE_SYMBOL(start)[];
extern const uint8_t BOOTIMAGE_SYMBOL(end)[];
EXPORT const uint8_t*
AVIAN_EXPORT const uint8_t*
bootimageBin(unsigned* size)
{
*size = BOOTIMAGE_SYMBOL(end) - BOOTIMAGE_SYMBOL(start);
@ -56,7 +41,7 @@ extern "C" {
extern const uint8_t CODEIMAGE_SYMBOL(start)[];
extern const uint8_t CODEIMAGE_SYMBOL(end)[];
EXPORT const uint8_t*
AVIAN_EXPORT const uint8_t*
codeimageBin(unsigned* size)
{
*size = CODEIMAGE_SYMBOL(end) - CODEIMAGE_SYMBOL(start);
@ -82,7 +67,7 @@ extern "C" {
extern const uint8_t SYMBOL(start)[];
extern const uint8_t SYMBOL(end)[];
EXPORT const uint8_t*
AVIAN_EXPORT const uint8_t*
classpathJar(unsigned* size)
{
*size = SYMBOL(end) - SYMBOL(start);

View File

@ -13,24 +13,15 @@
#include <stdint.h>
#include "avian/embed.h"
#include "avian/common.h"
#include "jni.h"
#if (defined __MINGW32__) || (defined _MSC_VER)
# define EXPORT __declspec(dllexport)
# ifdef _MSC_VER
# define not !
# endif
#else
# define EXPORT __attribute__ ((visibility("default"))) \
__attribute__ ((used))
#endif
extern "C" {
// since we aren't linking against libstdc++, we must implement this
// ourselves:
void __cxa_pure_virtual(void) { abort(); }
EXPORT const uint8_t*
AVIAN_EXPORT const uint8_t*
bootJar(unsigned* size)
{
if(HRSRC hResInfo = FindResourceW(NULL, RESID_BOOT_JAR, reinterpret_cast<LPCWSTR>(RT_RCDATA)))