[LLVMbugs] [Bug 15393] New: error LNK2017: 'ADDR32' relocation to '.debug_str' invalid without /LARGEADDRESSAWARE:NO

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 28 08:02:24 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15393

            Bug ID: 15393
           Summary: error LNK2017: 'ADDR32' relocation to '.debug_str'
                    invalid without /LARGEADDRESSAWARE:NO
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm at meinersbur.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Compiling any program using -g flag fails for target "x86_64-pc-win32"

>type hello.c
#include <stdio.h>

int main(int argc, char *argv[]) {
  printf("Hello World!");
  return 0;
}


>clang hello.c -o hello.exe -g -target "x86_64-pc-win32" -fno-exceptions -fno-cxx-exceptions -fno-use-cxa-atexit -v
clang version 3.3
Target: x86_64-pc-win32
Thread model: posix
clang: warning: argument unused during compilation: '-fno-cxx-exceptions'
 "C:/Users/Meinersbur/src/molly/build64_vc11/bin/Debug/clang.exe" -cc1 -triple
x86_64-pc-win32 -emit-obj -mrelax-all -disable-free -main-file-name hello.c
-mrelocation-model pic -p
ic-level 2 -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -g
-resource-dir "C:/Users/Meinersbur/
src/molly/build64_vc11/bin/Debug\\..\\lib\\clang\\3.3" -internal-isystem
C:/Users/Meinersbur/src/molly/build64_vc11/bin/Debug/../lib/clang/3.3/include
-internal-isystem "C:\\Progra
m Files (x86)\\Microsoft Visual Studio 11.0\\VC\\INCLUDE" -internal-isystem
"C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\ATLMFC\\INCLUDE"
-internal-isystem "C:\\Prog
ram Files (x86)\\Windows Kits\\8.0\\include\\shared" -internal-isystem
"C:\\Program Files (x86)\\Windows Kits\\8.0\\include\\um" -internal-isystem
"C:\\Program Files (x86)\\Windows
 Kits\\8.0\\include\\winrt" -ferror-limit 19 -fmessage-length 180
-mstackrealign -fno-use-cxa-atexit -fms-extensions -fms-compatibility
-fmsc-version=1300 -fdelayed-template-parsin
g -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-o C:/Users/MEINER~1/AppData/Local/Temp/hel
lo-669244.o -x c hello.c
clang -cc1 version 3.3 based upon LLVM 3.3svn default target x86_64-pc-win32
#include "..." search starts here:
#include <...> search starts here:
 C:/Users/Meinersbur/src/molly/build64_vc11/bin/Debug/../lib/clang/3.3/include
 C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE
 C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ATLMFC\INCLUDE
 C:\Program Files (x86)\Windows Kits\8.0\include\shared
 C:\Program Files (x86)\Windows Kits\8.0\include\um
 C:\Program Files (x86)\Windows Kits\8.0\include\winrt
End of search list.
 "C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/BIN/amd64/link.exe"
-out:hello.exe -defaultlib:libcmt -nologo
C:/Users/MEINER~1/AppData/Local/Temp/hello-669244.o
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_str' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_str' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_line' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_str' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_str' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_str' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_str' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_str' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.debug_str' invalid
without /LARGEADDRESSAWARE:NO
hello-669244.o : error LNK2017: 'ADDR32' relocation to '.text' invalid without
/LARGEADDRESSAWARE:NO
LINK : fatal error LNK1165: link failed because of fixup errors
clang: error: linker command failed with exit code 1165 (use -v to see
invocation)


This is working:
> clang -c hello.c -o hello.obj -g -target "x86_64-pc-win32" -fno-exceptions -fno-cxx-exceptions -fno-use-cxa-atexit -v
[...]
> "C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/BIN/amd64/link.exe" -out:hello.exe -defaultlib:libcmt -nologo hello.obj /LARGEADDRESSAWARE:NO /MACHINE:X64
[...]
> hello.exe
Hello World!



However, restricting the address space to 31 bits doesn't seem to be the point
of compiling to a 64 bit target. Although, this applies only to the debug
version.

Using 
clang/llvm r175980
Windows 7
Visual Studio 2012 SP1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130228/79e960b7/attachment.html>


More information about the llvm-bugs mailing list