OLD | NEW |
(Empty) | |
| 1 diff --git a/bfd/configure b/bfd/configure |
| 2 --- a/bfd/configure |
| 3 +++ b/bfd/configure |
| 4 @@ -11809,9 +11809,7 @@ if test "${enable_plugins+set}" = set; then : |
| 5 enableval=$enable_plugins; case "${enableval}" in |
| 6 no) plugins=no ;; |
| 7 *) plugins=yes |
| 8 - if test "$maybe_plugins" != "yes" ; then |
| 9 - as_fn_error "Building with plugin support requires a host that suppor
ts dlopen." "$LINENO" 5 |
| 10 - fi ;; |
| 11 + ;; |
| 12 esac |
| 13 else |
| 14 plugins=$maybe_plugins |
| 15 diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c |
| 16 --- a/bfd/elfxx-mips.c |
| 17 +++ b/bfd/elfxx-mips.c |
| 18 @@ -2161,6 +2161,7 @@ got_page_reloc_p (unsigned int r_type) |
| 19 return r_type == R_MIPS_GOT_PAGE || r_type == R_MICROMIPS_GOT_PAGE; |
| 20 } |
| 21 |
| 22 +#if !defined(__native_client__) |
| 23 static inline bfd_boolean |
| 24 got_ofst_reloc_p (unsigned int r_type) |
| 25 { |
| 26 @@ -2172,6 +2173,7 @@ got_hi16_reloc_p (unsigned int r_type) |
| 27 { |
| 28 return r_type == R_MIPS_GOT_HI16 || r_type == R_MICROMIPS_GOT_HI16; |
| 29 } |
| 30 +#endif |
| 31 |
| 32 static inline bfd_boolean |
| 33 got_lo16_reloc_p (unsigned int r_type) |
| 34 diff --git a/bfd/opncls.c b/bfd/opncls.c |
| 35 --- a/bfd/opncls.c |
| 36 +++ b/bfd/opncls.c |
| 37 @@ -673,6 +673,9 @@ bfd_openw (const char *filename, const char *target) |
| 38 static inline void |
| 39 _maybe_make_executable (bfd * abfd) |
| 40 { |
| 41 +#if defined(__native_client__) |
| 42 + (void) abfd; |
| 43 +#else |
| 44 /* If the file was open for writing and is now executable, |
| 45 make it so. */ |
| 46 if (abfd->direction == write_direction |
| 47 @@ -694,6 +697,7 @@ _maybe_make_executable (bfd * abfd) |
| 48 & (buf.st_mode | ((S_IXUSR | S_IXGRP | S_IXOTH) &~ mask)))); |
| 49 } |
| 50 } |
| 51 +#endif |
| 52 } |
| 53 |
| 54 /* |
| 55 diff --git a/bfd/plugin.c b/bfd/plugin.c |
| 56 --- a/bfd/plugin.c |
| 57 +++ b/bfd/plugin.c |
| 58 @@ -28,6 +28,8 @@ |
| 59 #include <dlfcn.h> |
| 60 #elif defined (HAVE_WINDOWS_H) |
| 61 #include <windows.h> |
| 62 +#elif defined (__native_client__) |
| 63 +// Handled inline. |
| 64 #else |
| 65 #error Unknown how to handle dynamic-load-libraries. |
| 66 #endif |
| 67 @@ -204,13 +206,19 @@ try_claim (bfd *abfd) |
| 68 static int |
| 69 try_load_plugin (const char *pname, bfd *abfd) |
| 70 { |
| 71 +#if !defined(__native_client__) |
| 72 void *plugin_handle; |
| 73 +#endif |
| 74 int tv_size = 4; |
| 75 struct ld_plugin_tv tv[tv_size]; |
| 76 int i; |
| 77 ld_plugin_onload onload; |
| 78 enum ld_plugin_status status; |
| 79 |
| 80 +#if defined(__native_client__) |
| 81 + (void) pname; |
| 82 + onload = 0; |
| 83 +#else |
| 84 plugin_handle = dlopen (pname, RTLD_NOW); |
| 85 if (!plugin_handle) |
| 86 { |
| 87 @@ -221,6 +229,7 @@ try_load_plugin (const char *pname, bfd *abfd) |
| 88 onload = dlsym (plugin_handle, "onload"); |
| 89 if (!onload) |
| 90 goto err; |
| 91 +#endif |
| 92 |
| 93 i = 0; |
| 94 tv[i].tv_tag = LDPT_MESSAGE; |
| 95 @@ -252,7 +261,9 @@ try_load_plugin (const char *pname, bfd *abfd) |
| 96 return 1; |
| 97 |
| 98 err: |
| 99 +#if !defined(__native_client__) |
| 100 plugin_handle = NULL; |
| 101 +#endif |
| 102 return 0; |
| 103 } |
| 104 |
| 105 diff --git a/binutils/configure b/binutils/configure |
| 106 --- a/binutils/configure |
| 107 +++ b/binutils/configure |
| 108 @@ -11373,9 +11373,7 @@ if test "${enable_plugins+set}" = set; then : |
| 109 enableval=$enable_plugins; case "${enableval}" in |
| 110 no) plugins=no ;; |
| 111 *) plugins=yes |
| 112 - if test "$maybe_plugins" != "yes" ; then |
| 113 - as_fn_error "Building with plugin support requires a host that suppor
ts dlopen." "$LINENO" 5 |
| 114 - fi ;; |
| 115 + ;; |
| 116 esac |
| 117 else |
| 118 plugins=$maybe_plugins |
| 119 diff --git a/gas/configure b/gas/configure |
| 120 --- a/gas/configure |
| 121 +++ b/gas/configure |
| 122 @@ -11353,9 +11353,7 @@ if test "${enable_plugins+set}" = set; then : |
| 123 enableval=$enable_plugins; case "${enableval}" in |
| 124 no) plugins=no ;; |
| 125 *) plugins=yes |
| 126 - if test "$maybe_plugins" != "yes" ; then |
| 127 - as_fn_error "Building with plugin support requires a host that suppor
ts dlopen." "$LINENO" 5 |
| 128 - fi ;; |
| 129 + ;; |
| 130 esac |
| 131 else |
| 132 plugins=$maybe_plugins |
| 133 diff --git a/gold/Makefile.in b/gold/Makefile.in |
| 134 --- a/gold/Makefile.in |
| 135 +++ b/gold/Makefile.in |
| 136 @@ -563,7 +563,7 @@ incremental_dump_SOURCES = incremental-dump.cc |
| 137 incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \ |
| 138 $(LIBINTL_DEP) |
| 139 |
| 140 -incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \ |
| 141 +incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(L
IBINTL) \ |
| 142 $(THREADSLIB) $(LIBDL) |
| 143 |
| 144 dwp_SOURCES = dwp.cc |
| 145 diff --git a/gold/descriptors.cc b/gold/descriptors.cc |
| 146 --- a/gold/descriptors.cc |
| 147 +++ b/gold/descriptors.cc |
| 148 @@ -48,7 +48,7 @@ static inline void |
| 149 set_close_on_exec(int fd ATTRIBUTE_UNUSED) |
| 150 { |
| 151 // @LOCALMOD-SB-BEGIN |
| 152 -#if defined(__native_client__) |
| 153 +#if 0 && defined(__native_client__) |
| 154 gold::gold_fatal(_("NaCl gold: unexpected use of fcntl for %d"), fd); |
| 155 #else |
| 156 // Mingw does not define F_SETFD. |
| 157 diff --git a/gold/fileread.cc b/gold/fileread.cc |
| 158 --- a/gold/fileread.cc |
| 159 +++ b/gold/fileread.cc |
| 160 @@ -180,7 +180,7 @@ File_read::~File_read() |
| 161 if (this->is_descriptor_opened_) |
| 162 { |
| 163 // @LOCALMOD-SB-BEGIN |
| 164 -#if defined(__native_client__) |
| 165 +#if 0 && defined(__native_client__) |
| 166 nacl_file::NaClReleaseFileDescriptor(this->descriptor_); |
| 167 #else |
| 168 release_descriptor(this->descriptor_, true); |
| 169 @@ -205,7 +205,7 @@ File_read::open(const Task* task, const std::string& name) |
| 170 this->name_ = name; |
| 171 |
| 172 // @LOCALMOD-SB-BEGIN |
| 173 -#if defined(__native_client__) |
| 174 +#if 0 && defined(__native_client__) |
| 175 this->descriptor_ = nacl_file::NaClOpenFileDescriptor(this->name_.c_str()); |
| 176 #else |
| 177 this->descriptor_ = open_descriptor(-1, this->name_.c_str(), |
| 178 @@ -257,7 +257,7 @@ File_read::reopen_descriptor() |
| 179 { |
| 180 |
| 181 // @LOCALMOD-SB-BEGIN |
| 182 -#if defined(__native_client__) |
| 183 +#if 0 && defined(__native_client__) |
| 184 this->descriptor_ = nacl_file::NaClOpenFileDescriptor(this->name_.c_str()
); |
| 185 #else |
| 186 this->descriptor_ = open_descriptor(this->descriptor_, |
| 187 @@ -300,7 +300,7 @@ File_read::release() |
| 188 if (this->is_descriptor_opened_) |
| 189 { |
| 190 // @LOCALMOD-SB-BEGIN |
| 191 -#if defined(__native_client__) |
| 192 +#if 0 && defined(__native_client__) |
| 193 nacl_file::NaClReleaseFileDescriptor(this->descriptor_); |
| 194 #else |
| 195 release_descriptor(this->descriptor_, false); |
| 196 diff --git a/gold/main.cc b/gold/main.cc |
| 197 --- a/gold/main.cc |
| 198 +++ b/gold/main.cc |
| 199 @@ -137,7 +137,7 @@ write_debug_script(std::string, const char*, const char*) |
| 200 // For the in-browser sandboxed build, main() is defined in |
| 201 // nacl_file.cc and calls an IRT interface for handling the browser's |
| 202 // request. gold_main() is called by that request handler. |
| 203 -#if defined(__native_client__) |
| 204 +#if 0 && defined(__native_client__) |
| 205 int |
| 206 gold_main(int argc, char** argv) |
| 207 #else |
| 208 @@ -162,7 +162,7 @@ main(int argc, char** argv) |
| 209 // @LOCALMOD-SB: skip this in sandboxed mode since the commandline we |
| 210 // build will likely not have @filename (and we can avoid hijacking |
| 211 // the file open operation there). |
| 212 -#if !defined(__native_client__) |
| 213 +#if 1 || !defined(__native_client__) |
| 214 expandargv(&argc, &argv); |
| 215 #endif |
| 216 |
| 217 @@ -341,7 +341,7 @@ main(int argc, char** argv) |
| 218 // @LOCALMOD-SB-BEGIN |
| 219 // This function is called from an IPC request handler. We do not |
| 220 // want it to exit. |
| 221 -#if defined(__native_client__) |
| 222 +#if 0 && defined(__native_client__) |
| 223 return errors.error_count() > 0; |
| 224 #else |
| 225 // If the user used --noinhibit-exec, we force the exit status to be |
| 226 diff --git a/gold/output.cc b/gold/output.cc |
| 227 --- a/gold/output.cc |
| 228 +++ b/gold/output.cc |
| 229 @@ -5017,7 +5017,7 @@ Output_file::open(off_t file_size) |
| 230 // We let the name "-" mean "stdout" |
| 231 |
| 232 // @LOCALMOD-SB-BEGIN |
| 233 -#if defined(__native_client__) |
| 234 +#if 0 && defined(__native_client__) |
| 235 int o = nacl_file::NaClOpenFileDescriptor(this->name_); |
| 236 if (o < 0) |
| 237 gold_fatal(_("%s: open: %s"), this->name_, strerror(errno)); |
| 238 @@ -5037,6 +5037,7 @@ Output_file::open(off_t file_size) |
| 239 ::unlink(this->name_); |
| 240 else if (!parameters->options().relocatable()) |
| 241 { |
| 242 +#if !defined(__native_client__) |
| 243 // If we don't unlink the existing file, add execute |
| 244 // permission where read permissions already exist |
| 245 // and where the umask permits. |
| 246 @@ -5044,6 +5045,7 @@ Output_file::open(off_t file_size) |
| 247 ::umask(mask); |
| 248 s.st_mode |= (s.st_mode & 0444) >> 2; |
| 249 ::chmod(this->name_, s.st_mode & ~mask); |
| 250 +#endif |
| 251 } |
| 252 } |
| 253 |
| 254 diff --git a/gold/plugin.cc b/gold/plugin.cc |
| 255 --- a/gold/plugin.cc |
| 256 +++ b/gold/plugin.cc |
| 257 @@ -33,6 +33,8 @@ |
| 258 #include <dlfcn.h> |
| 259 #elif defined (HAVE_WINDOWS_H) |
| 260 #include <windows.h> |
| 261 +#elif defined (__native_client__) |
| 262 +/* Handled inline. */ |
| 263 #else |
| 264 #error Unknown how to handle dynamic-load-libraries. |
| 265 #endif |
| 266 @@ -74,6 +76,10 @@ dlerror(void) |
| 267 #include "descriptors.h" |
| 268 #include "elfcpp.h" |
| 269 |
| 270 +#if defined(__native_client__) |
| 271 +extern "C" ld_plugin_status LLVMgold_onload(ld_plugin_tv *tv); |
| 272 +#endif |
| 273 + |
| 274 namespace gold |
| 275 { |
| 276 |
| 277 @@ -178,6 +184,9 @@ void |
| 278 Plugin::load() |
| 279 { |
| 280 #ifdef ENABLE_PLUGINS |
| 281 +#if defined(__native_client__) |
| 282 + ld_plugin_onload onload = ::LLVMgold_onload; |
| 283 +#else |
| 284 // Load the plugin library. |
| 285 // FIXME: Look for the library in standard locations. |
| 286 this->handle_ = dlopen(this->filename_.c_str(), RTLD_NOW); |
| 287 @@ -199,6 +208,7 @@ Plugin::load() |
| 288 ld_plugin_onload onload; |
| 289 gold_assert(sizeof(onload) == sizeof(ptr)); |
| 290 memcpy(&onload, &ptr, sizeof(ptr)); |
| 291 +#endif |
| 292 |
| 293 // Get the linker's version number. |
| 294 const char* ver = get_version_string(); |
| 295 diff --git a/gprof/configure b/gprof/configure |
| 296 --- a/gprof/configure |
| 297 +++ b/gprof/configure |
| 298 @@ -11283,9 +11283,7 @@ if test "${enable_plugins+set}" = set; then : |
| 299 enableval=$enable_plugins; case "${enableval}" in |
| 300 no) plugins=no ;; |
| 301 *) plugins=yes |
| 302 - if test "$maybe_plugins" != "yes" ; then |
| 303 - as_fn_error "Building with plugin support requires a host that suppor
ts dlopen." "$LINENO" 5 |
| 304 - fi ;; |
| 305 + ;; |
| 306 esac |
| 307 else |
| 308 plugins=$maybe_plugins |
| 309 diff --git a/ld/configure b/ld/configure |
| 310 --- a/ld/configure |
| 311 +++ b/ld/configure |
| 312 @@ -15109,14 +15109,14 @@ fi |
| 313 done |
| 314 |
| 315 |
| 316 +enable_plugins=no |
| 317 + |
| 318 # Check whether --enable-plugins was given. |
| 319 if test "${enable_plugins+set}" = set; then : |
| 320 enableval=$enable_plugins; case "${enableval}" in |
| 321 no) plugins=no ;; |
| 322 *) plugins=yes |
| 323 - if test "$maybe_plugins" != "yes" ; then |
| 324 - as_fn_error "Building with plugin support requires a host that suppor
ts dlopen." "$LINENO" 5 |
| 325 - fi ;; |
| 326 + ;; |
| 327 esac |
| 328 else |
| 329 plugins=$maybe_plugins |
| 330 diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c |
| 331 --- a/libiberty/strsignal.c |
| 332 +++ b/libiberty/strsignal.c |
| 333 @@ -550,6 +550,7 @@ followed by a newline. |
| 334 |
| 335 #ifndef HAVE_PSIGNAL |
| 336 |
| 337 +#if !defined(__native_client__) |
| 338 void |
| 339 psignal (int signo, char *message) |
| 340 { |
| 341 @@ -566,6 +567,7 @@ psignal (int signo, char *message) |
| 342 fprintf (stderr, "%s: %s\n", message, sys_siglist[signo]); |
| 343 } |
| 344 } |
| 345 +#endif |
| 346 |
| 347 #endif /* ! HAVE_PSIGNAL */ |
| 348 |
| 349 diff --git a/libiberty/vfork.c b/libiberty/vfork.c |
| 350 --- a/libiberty/vfork.c |
| 351 +++ b/libiberty/vfork.c |
| 352 @@ -11,6 +11,7 @@ Emulates @code{vfork} by calling @code{fork} and returning its
value. |
| 353 |
| 354 */ |
| 355 |
| 356 +#if !defined(__native_client__) |
| 357 #include "ansidecl.h" |
| 358 |
| 359 extern int fork (void); |
| 360 @@ -20,3 +21,4 @@ vfork (void) |
| 361 { |
| 362 return (fork ()); |
| 363 } |
| 364 +#endif |
| 365 diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c |
| 366 --- a/opcodes/mips-dis.c |
| 367 +++ b/opcodes/mips-dis.c |
| 368 @@ -157,6 +157,7 @@ static const char * const mips_cp0_names_r5900[32] = |
| 369 "c0_taglo", "c0_taghi", "c0_errorepc", "$31" |
| 370 }; |
| 371 |
| 372 +#if !defined(__native_client__) |
| 373 static const struct mips_cp0sel_name mips_cp0sel_names_mipsr5900[] = |
| 374 { |
| 375 { 24, 2, "c0_iab" }, |
| 376 @@ -168,6 +169,7 @@ static const struct mips_cp0sel_name mips_cp0sel_names_mipsr
5900[] = |
| 377 { 25, 1, "c0_perfcnt,1" }, |
| 378 { 25, 2, "c0_perfcnt,2" } |
| 379 }; |
| 380 +#endif |
| 381 |
| 382 static const char * const mips_cp0_names_mips3264[32] = |
| 383 { |
OLD | NEW |