Re: UUIDs generated using ossp-uuid on windows not unique

From: MUHAMMAD ASIF <anaeem(dot)it(at)hotmail(dot)com>
To: <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <dpage(at)postgresql(dot)org>, <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: UUIDs generated using ossp-uuid on windows not unique
Date: 2010-03-31 06:40:33
Message-ID: SNT127-W4040AEB6EDFCED7B7D8575FF1E0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> To: anaeem(dot)it(at)hotmail(dot)com
> CC: dpage(at)postgresql(dot)org; z-saito(at)guitar(dot)ocn(dot)ne(dot)jp; pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] UUIDs generated using ossp-uuid on windows not unique
> Date: Tue, 30 Mar 2010 10:01:50 -0400
> From: tgl(at)sss(dot)pgh(dot)pa(dot)us
>
> MUHAMMAD ASIF <anaeem(dot)it(at)hotmail(dot)com> writes:
> > I have downloaded uuid-1.6.2.tar.gz from http://www.ossp.org/pkg/lib/uuid/ . It successfully built with MinGW gcc and made libuuid.a, I renamed it to uuid.lib to build uuid-ossp contrib module with visual studio 2005. uuid-ossp give the following linker error with VC2005 i.e.
> >
> > Linking...
> > Creating library Release\uuid-ossp\uuid-ossp.lib and object Release\uuid-ossp\uuid-ossp.exp
> > uuid.lib(uuid_time.o) : error LNK2019: unresolved external symbol ___divdi3 referenced in function _uuid_time_gettimeofday
> > uuid.lib(uuid_time.o) : error LNK2019: unresolved external symbol ___moddi3 referenced in function _uuid_time_gettimeofday
> > uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___umoddi3 referenced in function _fmtint
> > uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___udivdi3 referenced in function _fmtint
> > .\Release\uuid-ossp\uuid-ossp.dll : fatal error LNK1120: 4 unresolved externals
>
> Generally, gcc is supposed to arrange for -lgcc to be included
> automatically in links if it's needed. I have seen failures like this
> before on other platforms, and it generally had something to do with
> using gcc followed by a non-gnu linker; which indeed seems to describe
> what you did here. I would suggest adding -lgcc to your VC project;
> or maybe where it actually went missing was in your build of libuuid.
>

you are right its not good idea to generate binary with non compatible tools that may lead to unexpected results and could make debugging worse.

> > MinGW libgcc.a contains these symbols and these routines are not
> > implemented in c ( its assembly code to make it fast ) so I extracted
> > _divdi3.o _moddi3.o _umoddi3.o _udivdi3.o (we can add these additional
> > files to uuid.lib to make build easy) from libgcc.a and link it with
> > uuid-ossp contrib.
>
> This seems entirely inappropriate; it makes unwarranted assumptions
> about which parts of libgcc are needed, and we couldn't ship any such
> thing anyhow for license reasons.
>
> regards, tom lane

I dont know much about licencing , I was assuming that if we can create application with gcc then we can use parts of gcc according to our will too. that was a wrong assumption, thank you for details :).

Best Regards,
Asif Naeem

_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message MUHAMMAD ASIF 2010-03-31 06:48:15 Re: UUIDs generated using ossp-uuid on windows not unique
Previous Message Dmitry Fefelov 2010-03-31 05:58:01 Feature request - function-based deferrable uniques.