strange -fPIC compilation error
Charles Hixson via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Oct 31 10:06:20 PDT 2016
On 10/31/2016 09:26 AM, Charles Hixson via Digitalmars-d-learn wrote:
> On 10/30/2016 11:34 PM, Daniel Kozak via Digitalmars-d-learn wrote:
>> Dne 31.10.2016 v 02:30 Charles Hixson via Digitalmars-d-learn napsal(a):
>>
>>>
>>> Well, that certainly changed the error messages. With
>>> dmd -defaultlib=/usr/lib/x86_64-linux-gnu/libphobos2.so test.d
>>> I get:
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1121): Error:
>>> found 'nothrow' when expecting '{'
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1123): Error:
>>> mismatched number of curly brackets
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1124): Error:
>>> mismatched number of curly brackets
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1125): Error:
>>> mismatched number of curly brackets
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1126): Error:
>>> mismatched number of curly brackets
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1127): Error:
>>> mismatched number of curly brackets
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1128): Error:
>>> mismatched number of curly brackets
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1129): Error:
>>> mismatched number of curly brackets
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1133): Error: asm
>>> statements must end in ';'
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1136): Error:
>>> found 'private' instead of statement
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1146): Error: no
>>> identifier for declarator add
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1149): Error: no
>>> identifier for declarator usDone
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1149): Error:
>>> Declaration expected, not ':'
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1157): Error:
>>> Declaration expected, not '('
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1159): Error:
>>> Declaration expected, not 'foreach'
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1159): Error:
>>> Declaration expected, not '0'
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1164): Error: no
>>> identifier for declarator __fhnd_info[fd]
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1164): Error:
>>> Declaration expected, not '='
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1165): Error:
>>> Declaration expected, not 'return'
>>> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1167): Error:
>>> unrecognized declaration
>>> /usr/include/dmd/phobos/std/typecons.d(1124): Error: semicolon
>>> expected following function declaration
>>>
>> This seems to be problem with your installation, you probably have
>> diferen version of dmd compiler and phobos library. So you should
>> uninstall all your dmd packages and make sure there is no
>> /usr/include/dmd left in your system. And instal dmd only from one
>> source (d-apt idealy).
>>
> I've done that 2 or 3 times. If that's the problem, then there are
> different versions stored in the repository. Since I'm on debian
> testing I'd been assuming that there'd been some system change since
> I'd last used the compiler, and the debs weren't yet up to date. The
> only updates to my system prior to the compiler breaking HAD been via
> apt-get. Since then I've used dpkg remove and install a couple of
> times to try other versions of dmd with no benefit.
> Currently dmd-bin version 2.071.2-0
> libphobos 2.071.2-0
> libphobos 2.071.2-0
> so they're LISTED as being the same version. And dmd.conf was
> installed by the deb, and is (eliminating the comments):
> [Environment32]
> DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import
> -L-L/usr/lib/i386-linux-gnu -L--export-dynamic
>
> [Environment64]
> DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import
> -L-L/usr/lib/x86_64-linux-gnu -L--export-dynamic
>
> But somewhere during the process (which included the nightly system
> update) the error messages changed, and now:
> dmd test.d
> yields:
> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1121): Error: found
> 'nothrow' when expecting '{'
> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1123): Error:
> mismatched number of curly brackets
> ...
> /usr/include/dmd/druntime/import/core/stdc/stdio.d(1167): Error:
> unrecognized declaration
> /usr/include/dmd/phobos/std/typecons.d(1124): Error: semicolon
> expected following function declaration
FWIW starting at /usr/include/dmd/druntime/import/core/stdc/stdio.d(1121)::
asm nothrow @nogc
{
mov EDX, num;
lock;
inc _iSemLockCtrs[EDX * 2];
so nothrow isn't being seen as appropriate at the beginning of an asm
block. After that I think it gets confused as 1123 doesn't HAVE a brace
(i.e. curly bracket) in it.
More information about the Digitalmars-d-learn
mailing list