I am trying to install gcc-2.7.2 after reading the requirements for installing Festival here. On my workstation, I have gcc 4.4.1 installed. I am running into problems while running make. Here is how I am running make:
make |& tee make.log
The error message is as follows:
decl.c: In function ‘push_class_level_binding’:
decl.c:3606: error: lvalue required as increment operand
The offending line from decl.c is: obstack_ptr_grow (&decl_obstack, x);
The above function returns void. A look at the function definition in the file obstack.h shows:
#define obstack_ptr_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (void *)); \
if (!__o->alloc_failed) \
*((void **)__o->next_free)++ = ((void *)datum); \
(void) 0; })
There is only one increment operation happening here. I am not sure how to change it to make the error go away. Or am I looking in the wrong place?
Any help is most welcome.
P.S: Please let me know in case more information is needed.
If the Festival folks suggest 2.7.2, their project would be completely abandoned for some reason. In fact, the festival folks themselves say they support gcc 4.5. So, if you experience problems like in the other post, go ahead and report them in the upstream.
Related
Some days ago I updated my UBUNTU distribution from 16.04.12 to 18.04.01.
This update caused the transition from gcc-5.4.0 to gcc-7-4-0.
In this system I developed an application in c that previously, compiled with the -Wall option,
did not generate warnings.
Now I obtain the following warning:
src/load_input_file.c: In function ‘load_input_file’:
src/load_input_file.c:60:23: warning: ‘%s’ directive writing up to 499 bytes into a region of size 196 [-Wformat-overflow=] o
sprintf(str,"cp %s %s",fileName,inputData.outDir);
^~ ~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
from hdr/load_input_file.h:3,
from src/load_input_file.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output 5 or more bytes (assuming 504) into a destination of size 200
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Could you help me to understand what is this warning and how to solve it?
Thank you
To solve the issue, following the suggestion of KamilCuk I trnsformed the code in the following way
sprintf(str,"cp %s %s",fileName,inputData.outDir);
to
sprintf(str,"cp ");
snprintf(str+strlen(str),strlen(fileName),"%s ",fileName);
snprintf(str+strlen(str),strlen(inputData.outDir),"%s",inputData.outDir);
Thank you
As you can read HERE GCC 7.1 introduced Wformat-overflow option.
This is why now is giving you that warning.
Most probably
sprintf(str,"cp %s %s",fileName,inputData.outDir);
can overflow because
sizeof(fileName)+sizeof(inputData.outDir) > sizeof(str)
I'm attempting to create an image with
bitbake core-image-minimal
For my jetson nano (nvidia tegra). I've added the meta-layer for tegra devices from https://github.com/madisongh/meta-tegra
and added it to bblayer.conf. I have also added lines
IMAGE_CLASSES += "image_types_tegra"
IMAGE_FSTYPES = "tegraflash"
to the local.conf file to be able to flash it later.
When I attempt to run the bitbake command to create the image, I get the error message:
ERROR: No recipes available for:
/home/mci/yocto/jetson-nano/meta-tegra/recipes-graphics/vulkan/vulkan-loader_1.1.%.bbappend
/home/mci/yocto/jetson-nano/meta-tegra/recipes-graphics/vulkan/vulkan-tools_1.1.%.bbappend
/home/mci/yocto/jetson-nano/meta-tegra/recipes-graphics/wayland/weston_7.0.0.bbappend
But aren't the files it says there is no recipes for the same recipes it's looking for? Isn't "vulkan-loader_1.1.%.bbappend" a recipe?
How do I solve this problem? Is it because it can't find the files or is the bbappend not the recipes but something else?
Michael,
I don't have an answer for the vulkan pieces but I do have a few pointers since we seem to be going down a similar path with the nano.
Use the warrior branch of yocto
You'll need to download the binary pieces of the nvidia sdk through the SDK manager
Point to these sdk packages in your local.conf with the NVIDIA_DEVNET_MIRROR variable. ex: "file:///home/nvidia/yocto/git/poky/devnet/nano-dev"
Because of the binary pieces in step 2, you need to use an older gcc version which isn't really supported in warrior. I used the linaro-7.2 layer.
Since gcc7 is not supported in warrior, yocto / openembedded will attempt to pass flags to gcc which will make the build fail. Here's a summary, which I hope is complete, to help you through this.
Add DEBUG_PREFIX_MAP="" to local.conf and apply the following patch.
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 174ce5a8c0..e8d651a010 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
## -128,7 +128,7 ## do_prepare_config () {
${S}/.config.oe-tmp > ${S}/.config
fi
sed -i 's/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"/' ${S}/.config
- sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
+ #sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
}
# returns all the elements from the src uri that are .cfg files
diff --git a/meta/recipes-core/libxcrypt/libxcrypt.bb b/meta/recipes-core/libxcrypt/libxcrypt.bb
index 3b9af6d739..350f7807a7 100644
--- a/meta/recipes-core/libxcrypt/libxcrypt.bb
+++ b/meta/recipes-core/libxcrypt/libxcrypt.bb
## -24,7 +24,7 ## FILES_${PN} = "${libdir}/libcrypt*.so.* ${libdir}/libcrypt-*.so ${libdir}/libowc
S = "${WORKDIR}/git"
BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE} -std=gnu99"
-TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} -Wno-error=missing-attributes"
-CPPFLAGS_append_class-nativesdk = " -Wno-error=missing-attributes"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} "
+CPPFLAGS_append_class-nativesdk = " "
BBCLASSEXTEND = "nativesdk"
Best of luck! I apologize if this is a bit rough, but I'm just getting through this myself.
I deleted everything and started with a fresh build, did the EXACT same procedure and added all the same lines to the local.conf and bblayer.conf... But this time, bitbake command is running with no errors at all.
I'm trying to use gpg to --clearsign a file (for debian packaging purposes) from a script.
I have an exported password-less private-key.gpg file and want to:
gpg --clearsign -o output input
I don't want to mess with the current user's ~/.gnupg or /run/user/$(id -u)/gnupg because they have nothing to do with my script. Also, the script could be running in multiple instances simultaneously and I don't want them interfering with one another.
I thought that would be easy. Setup $GNUPGHOME to a temp dir and be done with it. But I cannot figure out how to get gpg to run in a script without messing with the user's standard configuration at all. It seems gpg has gone to great lengths to make it impossible to avoid the gpg-agent and gpg-agent insists on using global/hard-coded paths.
Can I keep everything under $GNUPGHOME? Or how do I safely use gpg from a shell script without influencing the user's config or use of gpg or other instances of my script?
Details
Reading the gpg docs I see that:
--use-agent
--no-use-agent
This is dummy option. gpg always requires the agent.
And gpg-agent docs say:
--use-standard-socket
--no-use-standard-socket
--use-standard-socket-p
Since GnuPG 2.1 the standard socket is always used.
These options have no more effect. The command gpg-agent
--use-standard-socket-p will thus always return success.
This "standard socket" is presumably in /run/user/$(id -u)/gnupg - so it seems I can't avoid gpg messing with the user's "normal" use of gpg.
Versions: gpg 2.1.18 on Debian 9 / stretch / stable
If you can't stop gpg from creating files, would it help to give gpg a place to put them that's unique to the current process?
# Create a temporary directory for gpg.
dir="$(mktemp -d)"
# Remove the directory and its contents when the script exits.
trap '[[ ! -d "${dir}" ]] || rm -r "${dir}"' EXIT
# Put your private-key.gpg in the temporary directory.
$(your command here)
# Tell gpg to use the temporary directory.
gpg --homedir "${dir}" --clearsign -o output input
After multiple hours of searching the internet for some option to enable running multiple instances of gpg-agent with different gnupg homes I tried just restricting the access to the global socket location and it worked. It fell back to placing the socket files in the gnupg home directory. I used bwrap to do that. Here's the full command that worked: bwrap --dev-bind / / --tmpfs /run/user/$(id -u)/gnupg gpg-agent .... Since your question is about scripts in general, you probably can't rely on bwrap being installed, so the next best thing is a shim that prevents gpg-agent from using the user's xdg runtime directory for its sockets.
After looking through the output of strace, the switch of location when running under bwrap to gnupg home seems to happen after a stat on /run/user/${UID}/gnupg is issued. Looking through the gpg-agent.c code this seems to do that check:
/* Check that it is a directory, owned by the user, and only the
* user has permissions to use it. */
if (!S_ISDIR(sb.st_mode)
|| sb.st_uid != getuid ()
|| (sb.st_mode & (S_IRWXG|S_IRWXO)))
{
*r_info |= 4; /* Bad permissions or not a directory. */
if (!skip_checks)
goto leave;
}
Using this we can just tell gpg-agent that the /run/user/${UID}/gnupg exists, but is not a directory, so it will fail the first of these checks.
Here's the code for a shim that does just that (could be better, but it works):
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <dlfcn.h>
#include <stdio.h>
#define STR_MAX 4096
#define MIN(a, b) (a < b ? a : b)
#define MAX(a, b) (a > b ? a : b)
// Set up checking stuff
#define MAX_UID_LEN 11
#define PREFIX_1 "/run/user"
#define PREFIX_2 "/var/run/user"
#define TEST_LEN_1 (sizeof(PREFIX_1) - 1 + 1 + MAX_UID_LEN + sizeof("/gnupg") - 1)
#define TEST_LEN_2 (sizeof(PREFIX_2) - 1 + 1 + MAX_UID_LEN + sizeof("/gnupg") - 1)
#define MAX_TEST_LEN MAX(TEST_LEN_1, TEST_LEN_2)
// Override stat function
int stat(const char *restrict pathname, struct stat *restrict statbuf) {
int (*original_stat)(const char *restrict, struct stat *restrict) = dlsym(RTLD_NEXT, "stat");
// Call original stat function
int retval = original_stat(pathname, statbuf);
if (retval == 0) {
// Check if a path we want to modify
size_t pathlen = strnlen(pathname, STR_MAX);
char path_check[MAX_TEST_LEN + 1];
snprintf(path_check, MAX_TEST_LEN + 1, "%s/%u/gnupg", PREFIX_1, getuid());
if (strncmp(pathname, path_check, MIN(MAX_TEST_LEN, pathlen)) == 0) {
// Report a regular file with perms: rwxrwxrwx
statbuf->st_mode = S_IFREG|0777;
}
snprintf(path_check, MAX_TEST_LEN + 1, "%s/%u/gnupg", PREFIX_2, getuid());
if (strncmp(pathname, path_check, MIN(MAX_TEST_LEN, pathlen)) == 0) {
// Report a regular file with perms: rwxrwxrwx
statbuf->st_mode = S_IFREG|0777;
}
}
return retval;
}
You can compile it with: clang -Wall -O2 -fpic -shared -ldl -o gpg-shim.so gpg-shim.c and then add it to LD_PRELOAD and it should then allow you to run multiple gpg-agents as long as they have different gnupg homes.
I know this answer is really late, but I hope it can help some people that were, like me, looking for a way to run multiple gpg-agents with different homedirs. (For my specific case, I wanted to run multiple gpg-agent instances to have keys cached different amounts of time).
I have spent the past several hours attempting to install a decompiler with no success. Since I've recently been using radare2 as a disassembler, I figured using the associated decompiler package would work well. After finding out that radeco and radeco-lib aren't currently stable enough to build, I used their package manager r2pm to finally install the r2snow BASH script in ~/.local/share/radare2/prefix/bin.
But now I cannot figure out how to run it to decompile a binary! The error message I receive is: "Usage: r2 -i '.!r2snow'". I know that r2 is shorthand for radare2, and the -i flag is to pass a script file to run, but I've tried passing it the r2snow BASH script in multiple ways with no success.
Does anyone with experience using this particular decompiler know how to properly invoke it? Normally I could figure this out myself, but the lack of proper documentation has proved too difficult.
I kid you not, every time you invoke the program improperly, it taunts you. Most recently: "Usage: r2 -i '.!r2snow'" -- This should be documented, since it's not that obvious. Maybe I should try a different decompiler altogether. Are there any free decompilers out there which are easier to set up?
To install radare2 plugins you should start with:
$ r2pm init
$ r2pm update
Then install your desired plugin using r2pm:
$ r2pm -i r2snow
You might get this error:
ERROR: Build failed. You probably need 'brew install cartr/qt4/qt' and
'brew install boost' or 'sudo apt-get install libboost-dev libqt4-dev'
So simply install the missing libraries:
$ sudo apt-get install libboost-dev libqt4-dev'
Then, you can call r2snow from wihtin r2 shell via !r2snow or from outside like r2 -i '.!r2snow' /bin/ls
Instead of r2snow, I'd suggest using r2dec or r2retdec.
To install r2dec:
$ r2pm -i r2dec
And then simply use pdd:
$ r2 -A my_file
...
[0x00000540]> s main
[0x000006a4]> pdd
int32_t main () {
/* arg1 */
*(local_14h) = edi;
/* arg2 */
*(local_20h) = rsi;
esi = 7;
edi = 0x61;
print_it (*(local_20h), *(local_14h));
esi = 0x11;
edi = 0x6b;
print_it (edi, esi);
*(local_4h) = 5;
edx = *(local_4h);
eax = edx;
eax += eax;
eax += edx;
*(local_4h) = eax;
eax = *(local_4h);
edi = eax;
dumb_function (edi);
esi = 9;
edi = 0x62;
print_it (edi, esi);
eax = 0;
return eax;
}
To install r2retdec:
$ r2pm -i r2retdec
Make sure to have npm installed and follow the instructions in the repository.
After you installed it, use $dec from within r2 shell.
An XCode project on OSX 10.6 fails building due to exit code 3 when trying to run Rez. What does this mean? I'm sure the files exist and all paths are set correctly, and have valid content. Google and AltaVista turn up nothing but others with the same question.
More generally, since I have a talent for creating errors on OSX, is there a list of all possible exit codes for Rez and what they mean? Are these standard among all of Apples command line programs?
UPDATE:
Here's the first .r file that Rez tries to compile, but stops with exit code 3:
// The About box and resources are created in PIUtilities.r.
// You can easily override them, if you like.
#define plugInName "HackFormat"
#define plugInCopyrightYear "1957"
#define plugInDescription \
"Hackup of sample plugin SimpleFormat to test plugin making procedures (DSW)"
// Dictionary (aete) resources:
#define vendorName "DarenTheMonkey"
#define plugInAETEComment "simpleformat example file format module"
#define plugInSuiteID 'sdK4'
#define plugInClassID 'simP'
#define plugInEventID typeNull // must be this
#include "PIDefines.h"
#include "Types.r"
#include "SysTypes.r"
#include "PIGeneral.r"
#include "PIUtilities.r"
#include "PITerminology.h"
#include "PIActions.h"
#include "HackFormatTerminology.h" // Terminology for plug-in.
//-------------------------------------------------------------------------------
// PiPL resource
//-------------------------------------------------------------------------------
resource 'PiPL' (ResourceID, plugInName " PiPL", purgeable)
{
{
Kind { ImageFormat },
Name { plugInName },
Version { (latestFormatVersion ", /* must be exactly this */
keyInherits, /* must be keyInherits */
classFormat, /* parent: Format, Import, Export */
"parent class format", /* optional description */
flagsSingleProperty, /* if properties, list below */
"foo",
keyMyFoo,
typeBoolean,
"foobar",
flagsSingleProperty,
"bar",
keyMyBar,
typeBoolean,
"foobar",
flagsSingleProperty
/* no properties */
},
{}, /* elements (not supported) */
/* class descriptions */
},
{}, /* comparison ops (not supported) */
{} /* any enumerations */
}
};
resource StringResource (kHistoryEntry, "History", purgeable)
{
plugInName ": ref num=^0."
};
// end file
and, from the xcode Build Results window, (just for this first .r file; rest are same)
Build HackFormat of project hackformat with configuration Debug
Check dependencies
[WARN]Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'.
Rez tmp/hackformat.build/Debug/HackFormat.build/ResourceManagerResources/Objects/HackFormat-A69F02213383561.rsrc HackFormat.r
cd /home/dwilson/proj/PSPlug/hackformat
/Developer/Tools/Rez -o /home/dwilson/proj/PSPlug/hackformat/tmp/hackformat.build/Debug/HackFormat.build/ResourceManagerResources/Objects/HackFormat-A69F02213383561.rsrc -d SystemSevenOrLater=1 -useDF -script Roman -arch x86_64 -i /home/dwilson/proj/PSPlug/hackformat/Debug -i /home/dwilson/proj/PSPlug/hackformat/sampcomm -i sampcomm -i /home/dwilson/proj/PSPlug/hackformat -i /home/dwilson/proj/PSPlug/hackformat/sampcomm -i /home/dwilson/SW/SDK/AdobePS/adobe_photoshop_cs5_sdk_mac/photoshopapi/photoshop -i /home/dwilson/SW/SDK/AdobePS/adobe_photoshop_cs5_sdk_mac/photoshopapi/pica_sp -i /Developer/Headers/FlatCarbon -i /home/dwilson/SW/SDK/AdobePS/adobe_photoshop_cs5_sdk_mac/photoshopapi/resources -i /home/dwilson/proj/PSPlug/hackformat/Debug -i /home/dwilson/proj/PSPlug/hackformat/Debug/include -i sampcomm /home/dwilson/proj/PSPlug/hackformat/../../../common/includes/MachOMacrezXcode.h -isysroot /Developer/SDKs/MacOSX10.5.sdk /home/dwilson/proj/PSPlug/hackformat/HackFormat.r
### /Developer/Tools/Rez - SysError 0 during open of "/home/dwilson/proj/PSPlug/hackformat/../../../common/includes/MachOMacrezXcode.h".
Fatal Error!
### /Developer/Tools/Rez - Fatal Error, can't recover.
/home/dwilson/proj/PSPlug/hackformat/../../../common/includes/MachOMacrezXcode.h: ### /Developer/Tools/Rez - Since errors occurred, /home/dwilson/proj/PSPlug/hackformat/tmp/hackformat.build/Debug/HackFormat.build/ResourceManagerResources/Objects/HackFormat-A69F02213383561.rsrc's resource fork was not written.
Command /Developer/Tools/Rez failed with exit code 3
From the Rez man page:
Rez can return the following status codes:
0 no errors
1 error in parameters
2 syntax error in resource description file
3 I/O or program error
man I'm just tagging along on this. I get Command /Developer/usr/bin/Rez failed with exit code 3
I've been looking everywhere for a comprehensive list of exit codes without any luck. Or at least any information on exit code 3.
Update: I just found this in here http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/codesign.1.html (I'm not sure if this applies in any way to xcode as it seems to be part of the darwin documentation and I know very little about it):
codesign exits 0 if all operations succeed. This indicates that all codes were signed, or all codes
verified properly as requested. If a signing or verification operation fails, the exit code is 1. Exit
code 2 indicates invalid arguments or parameters.
Exit code 3 indicates that during verification, all
path(s) were properly signed but at least one of them failed to satisfy the requirement specified with
the -R option.
For verification, all path arguments are always investigated before the program exits. For all other
operations, the program exits upon the first error encountered, and any further path arguments are
ignored, unless the --continue option was specified, in which case codesign will defer the failure exit
until after it has attempted to process all path arguments in turn.
Again I'm not sure but seems to be a permissions problem. Will investigate further!
I have found the problem! In Project Setting, there was a bad path in Rez Prefix File. It's supposed to be a path to a file MachOMacrezXcode.h. Now it is obvious that this file wasn't being found when I look at the Build Results. I have copied this file into my project source (since I want no dependencies on the original sample code I'm taking source from) and fixed the path.