[cfe-users] Reproducible builds

don hinton via cfe-users cfe-users at lists.llvm.org
Mon Aug 24 06:28:56 PDT 2015


You could try something like this:

template <int N>
class X{}

static X<SOME_INT> x;

// or

char str[SOME_INT];

then compile it like this:

clang++ -D$RANDOM -c file.cpp -o file.o

RANDOM is a bash thing, but basically you just need to generate a random
number each time you compile and pass it in as a macro.

hth...
don

On Mon, Aug 24, 2015 at 12:57 AM, Stephan Gatzka via cfe-users <
cfe-users at lists.llvm.org> wrote:

> Hi!
>
> I just added support for reproducible builds (-frandom-seed=) into the
> qbs build system.
>
> For a automated test case I'd like to have a small snippet of C/C++
> code, which definitely leads to different object files if compiled
> twice.
>
> I wasn't able to write such a snippet, so any help would be very
> appreciated.
>
> Regards,
>
> Stephan
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20150824/df897dd3/attachment.html>


More information about the cfe-users mailing list