You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The retdec runtime uses sed with flags that are incompatible with the sed built into MacOS, however the Run on MacOS instructions omit this requirement.
I resolved this by installing the gsed (sudo port install gsed) package and then including the GNU symlink tree (/opt/local/libexec/gnubin) in my path before the built-in directories. A similar solution using brew's gnu-sed package should work as well.
Environment
MacOS 10.13.3
Mac Ports
changeset: 31cf35f
Steps to Reproduce
Download, Build and Install on MacOS
sudo port selfupdate
sudo port install cmake git perl5 python27 bison flex autoconf automake libtool coreutils wget doxygen upx graphviz
# See #98
export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/libexec/gnubin:$PATH
git clone https://github.com/avast-tl/retdec
cd retdec
mkdir build && cd build
cmake .. -DCMAKE_INSTALLPREFIX=/opt/local/retdec
make -j6
sudo make install
Run against a simple test 32-bit Linux ELF binary
cd /opt/local/retdec/bin
bash ./retdec-decompiler.sh /tmp/test
… to work on macOS (#257).
The original commands failed with the following error on macOS:
sed: 1: "/private/tmp/test.c": undefined label 'mp/test.c'
sed: 1: "/private/tmp/test.c": undefined label 'mp/test.c'
The reason why the commands failed is that when using the -i parameter of sed
on macOS, you need to specify an extension of the backup file. If you do not
want to create a backup file, you have to pass the empty string. On Linux,
using just -i without any extension suffices.
The new sed command should work on Linux, macOS, and Windows, without a need to
install gnu-sed on macOS.
Thank you for the report. I have fixed this in commit 7b5289a. In short, I have modified our sed commands so that they work even with the version of sed on macOS, so there is no need for installing gsed.
The reason why the commands failed is that when using the -i parameter of sed on macOS, you need to specify an extension of the backup file. If you do not want to create a backup file, you have to pass the empty string. On Linux, using just -i without any extension suffices. Nevertheless, there were also some other issues with the original sed commands, so I rewrote them. Another advantage of the new version is that both sed commands are now part of a single sed command.
… to work on macOS (#257).
The original commands failed with the following error on macOS:
sed: 1: "/private/tmp/test.c": undefined label 'mp/test.c'
sed: 1: "/private/tmp/test.c": undefined label 'mp/test.c'
The reason why the commands failed is that when using the -i parameter of sed
on macOS, you need to specify an extension of the backup file. If you do not
want to create a backup file, you have to pass the empty string. On Linux,
using just -i without any extension suffices.
The new sed command should work on Linux, macOS, and Windows, without a need to
install gnu-sed on macOS.
The retdec runtime uses
sed
with flags that are incompatible with thesed
built into MacOS, however the Run on MacOS instructions omit this requirement.I resolved this by installing the
gsed
(sudo port install gsed
) package and then including the GNU symlink tree (/opt/local/libexec/gnubin
) in my path before the built-in directories. A similar solution using brew'sgnu-sed
package should work as well.Environment
MacOS 10.13.3
Mac Ports
changeset: 31cf35f
Steps to Reproduce
Download, Build and Install on MacOS
Run against a simple test 32-bit Linux ELF binary
Expected Behavior
Clean run
Observed Behavior
sed
errorsThe text was updated successfully, but these errors were encountered: