You are not logged in.

#1 2014-05-26 13:15:35

elken
Member
From: Emacs
Registered: 2013-10-17
Posts: 67

[SOLVED] Different outcome running makepkg vs running the commands.

Hi all,

I'm trying to build fatback, for blackarch mainly but I'll upload to AUR too, and I'm having some weird outcomes.

If I run makepkg -sfic on this, it fails with a load of compiler errors, but if I run the configure & make separately, it works fine, only complaining about flex library missing. See here
What gives?

Makepkg log
Command output 1
Command output 2
Command output 3

EDIT: Solution was a mix of environment variables for me, and the original dev making some mistakes, see last post.

Last edited by elken (2014-05-26 14:52:04)


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#2 2014-05-26 13:27:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Different outcome running makepkg vs running the commands.

From the title, I was going to suggest the differences would be in environment variables inherited from makepkg.conf - but after reading this the difference is much more clear: when you do it manually, you edit the makefile!

Patch the makefile with your change in the PKGBUILD.

If you don't manually edit the makefile to add the linker flag, do you get the same errors when building manually as you do with makepkg?  If so, that confirms that this is the only issue.

Last edited by Trilby (2014-05-26 13:28:00)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2014-05-26 13:30:32

elken
Member
From: Emacs
Registered: 2013-10-17
Posts: 67

Re: [SOLVED] Different outcome running makepkg vs running the commands.

No I should have been clearer, my apologies.

When I run makepkg, I get the errors specified, but if I run them myself, the only error I get is about flex library missing. I've edited OP and included an image. I thought it might have been env vars, here is my makepkg.conf, I can't see anything glaring. -D_FORTIFY_SOURCE maybe?

Last edited by elken (2014-05-26 13:36:05)


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#4 2014-05-26 13:35:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Different outcome running makepkg vs running the commands.

OK, then this is likely due to the flags specified in makepkg.conf.

You can test this by specifying the same flags:

source /etc/makepkg.conf
make CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS CXXFLAGS=$CXXFLAGS

EDIT: also, you may want to see this recurring theme in the grr thread.  Heeding the implied advice will make it much easier for other users here to see the output you're getting - and thus much more likely that they'll take the time to read it.

Last edited by Trilby (2014-05-26 13:37:52)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2014-05-26 13:38:23

elken
Member
From: Emacs
Registered: 2013-10-17
Posts: 67

Re: [SOLVED] Different outcome running makepkg vs running the commands.

Output. How queer.

EDIT: My apologies, I'm not used to pasting with sprunge yet, I forget about 2&>1. Output

Last edited by elken (2014-05-26 13:42:35)


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#6 2014-05-26 14:31:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Different outcome running makepkg vs running the commands.

Thanks for the text version.

I think we missed some makepkg flags.  I just tried this PKGBUILD - I get the same error you do with makepkg.  When I build manually I also get the flex errors that you just posted *unless* I export the makepkg variables - then I get the same error as with makepkg.  But above I missed "CPPFLAGS" - so try the following in the (clean) source directory:

source /etc/makepkg.conf
export CFLAGS
export LDFLAGS
export CPPFLAGS
export CXXFLAGS
./configure
make

This produces the same error as the makepkg for me.

EDIT: and I found the problem.  The upstream source was trying to pass definitions of data types through compiler "DEF" flags (eg -Dsize_t=unsigned)  This conflicted with the internal typdefs for these types included from header files.  Removing these absurd definitions allows it to compile.  Stand by for a patch/sed command for the PKGBUILD.

EDIT: Insert this in the PKGBUILD after the configure command and before make in the build function:

   sed -i 's/-Doff_t=long -Dpid_t=int -Dsize_t=unsigned//' Makefile

For explanation: the DEF flag defined "size_t" as "unsigned" so anytime the former was encountered in the code, it was replaced with the latter.  But in the code, included header files had lines like "typedef size_t unsigned;" which the preprocessor then turned into "typdedef unsigned unsigned;" which doesn't make any sense to the compiler.

Last edited by Trilby (2014-05-26 14:42:41)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2014-05-26 14:51:18

elken
Member
From: Emacs
Registered: 2013-10-17
Posts: 67

Re: [SOLVED] Different outcome running makepkg vs running the commands.

Ah, that makes sense. I was trying to individually patch the definitions. I didn't think it made much sense. Much appreciated, thanks!


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#8 2014-05-26 14:55:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Different outcome running makepkg vs running the commands.

Oh, are you the upstream source of those defs ... sorry about the "absurd" comment then, but - they kinda are wink


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2014-05-26 14:57:58

elken
Member
From: Emacs
Registered: 2013-10-17
Posts: 67

Re: [SOLVED] Different outcome running makepkg vs running the commands.

No no, it's not me, I was trying to rewrite them now tongue


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

Board footer

Powered by FluxBB