[Pdns-users] Solaris 11 SPARC pdns recursor compilation

Дмитрий Клим dklimentiev at gmail.com
Thu Apr 13 11:40:14 UTC 2017


BTW, I compiled gcc 4.9.4 but it got the same error as gcc 5.4.0.

So now I'm take a look at files generated for assembler.
This is the command which generates file from ws-recursor.cc for as:
 /opt/gcc-5.4.0/libexec/gcc/sparc-sun-solaris2.11/5.4.0/cc1plus -quiet -I .
-I ./ext/yahttp -I /opt/boost_1_63_0 -I ./ext/json11 -I
./ext/rapidjson/include -I ./ext/yahttp -I /opt/boost_1_63_0 -I
/opt/boost_1_63_0 -MD ws-recursor.d -MF .deps/ws-recursor.Tpo -MP -MT
ws-recursor.o -D__sparcv8 -D_REENTRANT -D_PTHREADS -D HAVE_CONFIG_H -D
SYSCONFDIR="/opt/pdns-recursor-4.0.4/etc" -D
SYSCONFDIR="/opt/pdns-recursor-4.0.4/etc" -D
PKGLIBDIR="/opt/pdns-recursor-4.0.4/lib/pdns-recursor" -D
LOCALSTATEDIR="/var/run" -D PIE -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D
_REENTRANT ws-recursor.cc -quiet -dumpbase ws-recursor.cc -mcpu=v9
-auxbase-strip ws-recursor.o -O3 -Wall -std=gnu++14 -fPIE -fstack-protector
--param ssp-buffer-size=4 -o /var/tmp//ccZ0n0Ad.s

This are first lines of the file in /var/tmp:
        .file   "ws-recursor.cc"
        .section .rodata
.global gLICENSEData
.type gLICENSEData, @object
.balign 4
gLICENSEData:
.incbin "html/LICENSE"
.global gLICENSEEnd

So to fix errors I make some changes:
ERROR: line 2: error: quoted-string operand required. Thats the line 2:
.section .rodata
I changed it to:
.section ".rodata"

ERROR: line 4: error: invalid character (0x40). Thats the line 4:
.type gLICENSEData, @object
I changed it to:
.type gLICENSEData, #object

ERROR:  line 5: error: unknown opcode ".balign", line 5: error: statement
syntax. Thats the line 5:
.balign 4
I changed it to:
.align 4

This changes fix above errors. The last error is:
line 7: error: unknown opcode ".incbin"

But .incbin is gnu assembler directive. I cant find its alternative in
Solaris assembler.

And if we take look at code generated for assembler from another
file "resolver.cc":
        .file   "resolver.cc"
        .section        ".text"
        .align 4
        .type   _ZL17__gthread_triggerv, #function
        .proc   020
We can see that it hasnt got errors with quotes, unknown symbols and
alignment. And thats why this file is assembling well.

I completely cant understand why cc1plus generates those wrong code for
ws-recursor.


2017-04-13 12:39 GMT+03:00 Дмитрий Клим <dklimentiev at gmail.com>:

> Thaigo,
> gcc 4.8.2 uses libstdc++.so.6.0.18, gcc 5.4.0 - libstdc++.so.6.0.21
>
> 2017-04-13 0:08 GMT+03:00 Thiago Farina <tfransosi at gmail.com>:
>
>>
>>
>> On Tue, Apr 11, 2017 at 2:31 PM, Дмитрий Клим <dklimentiev at gmail.com>
>> wrote:
>>
>>> Hello guys,
>>> I'm using pdns recursor 3.7.3 now (Solaris 11 sparc) which was compiled
>>> from sources.
>>> And I have an issue with pdns recursor upgrade to version 4.0.4.
>>>
>>> I'm using the latest Solaris 11.3 release
>>> root at rep11:/users/admin/pdns-recursor-4.0.4.1# pkg list entire
>>> NAME (PUBLISHER)                                  VERSION
>>>      IFO
>>> entire
>>>  0.5.11-0.175.3.17.0.5.0    i--
>>>
>>> So when I tried to build pdns with default Solaris gcc 4.8.2 I passed
>>> the configure:
>>> configure: Configuration summary
>>> configure: =====================
>>> configure:
>>> configure: PowerDNS Recursor configured with:
>>>  '--with-boost=/opt/boost_1_63_0' '--prefix=/opt/pdns-recursor-4.0.4'
>>> configure:
>>> configure: CC: gcc
>>> configure: CXX: g++
>>> configure: LD: /usr/bin/ld
>>> configure: CFLAGS: -fPIE -DPIE -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
>>> --param ssp-buffer-size=4 -fstack-protector -Wall -g -O2
>>> configure: CPPFLAGS:  -I/opt/boost_1_63_0 -pthreads
>>> configure: CXXFLAGS:  -fPIE -DPIE -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
>>> --param ssp-buffer-size=4 -fstack-protector -D_REENTRANT -Wall -g -O2
>>> -std=gnu++11
>>> configure: LDFLAGS:
>>> configure: LIBS: -lsocket -lnsl -lresolv -lposix4 -lpthread    -pthreads
>>> configure: BOOST_CPPFLAGS: -I/opt/boost_1_63_0 -pthreads
>>> configure:
>>> configure: Features enabled
>>> configure: ----------------
>>> configure: Lua: lua
>>> configure: OpenSSL ECDSA: no
>>> configure: Protobuf: no
>>> configure: systemd: no
>>> configure: Context library: System V ucontexts
>>>
>>> But than I got an error while gmake:
>>>
>>> gmake[2]: Entering directory `/users/admin/pdns-recursor-4.0.4.1'
>>>   CXX      arguments.o
>>> In file included from logger.hh:33:0,
>>>                  from arguments.cc:31:
>>> iputils.hh: In member function ‘std::string
>>> ComboAddress::toStringWithPort() const’:
>>> iputils.hh:274:33: error: ‘to_string’ is not a member of ‘std’
>>>        return toString() + ":" + std::to_string(ntohs(sin4.sin_port));
>>>                                  ^
>>>
>> What is the version of your libstd++?
>>
>> --
>> Thiago Farina
>>
>
>
>
> --
> С уважением,
> Климентьев Дмитрий
>



-- 
С уважением,
Климентьев Дмитрий
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20170413/44fc5133/attachment-0001.html>


More information about the Pdns-users mailing list