Thanks you all for review.

The comments now added:

## change special characters to fit for command line

## ( => \(

## ) => \)

## ".*" -> '".*"'

## < => \<

## > => \>

## | => \|

However, there is still an issue in the last system($cmd), perl will launch
a shell command to do $cmd, but the command result is shielded.For a build
system, this may ignore some errors.  As the perldoc pointed it out:

http://perldoc.perl.org/functions/system.html

When system <http://perldoc.perl.org/functions/system.html>'s arguments are
executed indirectly by the shell, results and return codes are subject to
its quirks. See `STRING` in
perlop<http://perldoc.perl.org/perlop.html#%60STRING%60>and
exec <http://perldoc.perl.org/functions/exec.html> for details.

So, I change the last "system" to "exec".

I will check it in later.

Regards
Gang


On Mon, Apr 16, 2012 at 11:08 AM, David Coakley <dcoak...@gmail.com> wrote:

> If you are looking for gatekeeper approval, the update looks ok to me,
> although a comment describing what these lines do would be nice:
>
>      $arg =~ s /\(/\\(/g;
>      $arg =~ s /\)/\\)/g;
>      $arg =~ s /"(.*)"$/'"$1"'/g;
>      $arg =~ s /\</\\</g;
>      $arg =~ s /\|/\\|/g;
>      $arg =~ s /\>/\\>/g;
>
>
> -David Coakley / AMD Open Source Compiler Engineering
>
> On Sat, Apr 14, 2012 at 12:40 AM, DONG Yuan <dongy...@tsinghua.edu.cn>
> wrote:
> > Hi, Gang,
> > The new patch looks ok to me.
> > Thanks a lot for the explanation.
> >
> > All the best,
> >
> > --Yuan
> > 在 2012-04-14六的 11:11 +0800,Gang Yu写道:
> >> Hi, Yuan:
> >>
> >>    Thanks for the comments
> >>
> >> On Sat, Apr 14, 2012 at 9:02 AM, DONG Yuan <dongy...@tsinghua.edu.cn>
> >> wrote:
> >>         Hi Gang,
> >>         I thinks use perl scripts is a good idea to handle more
> >>         complex options.
> >>
> >>         Just some ideas:
> >>         1) you use /usr/local/bin/perl, but on my ubuntu Linux, it
> >>         should
> >>         be /usr/bin/perl, is these any easy way to deal with it?
> >>
> >>    We can use /usr/bin/perl, perl as an essential package for linux
> >> distributions, a common place is /usr/bin. We just make a symbolic
> >> link in /usr/local/bin. thanks
> >>
> >>
> >>         2) I like the -v option, can we change it like this:
> >>         -      if ($arg eq "-v") { exit 0; }
> >>         +      if ($arg eq "-v") { system("Wrapper around opencc for
> >>         gcc
> >>         compatibility"); exit $?; }
> >>
> >> Yes. Sorry, this is a bug for the script, I haven't test -v and -help.
> >> The updated script has done that.
> >>
> >>         3) did you try it on a X86 machine?
> >>
> >> No, all the working machines are x86_64 based. I will have a test when
> >> I find one available.
> >>
> >>
> >> Regards
> >> Gang
> >>
> >>
> >>         在 2012-04-13五的 19:09 +0800,Gang Yu写道:
> >>         > The source file is in the attachment. Thanks
> >>         >
> >>         > Regards
> >>         > Gang
> >>         >
> >>         >
> >>         >
> >>         > On Fri, Apr 13, 2012 at 6:27 PM, Jian-Xin Lai
> >>         <laij...@gmail.com>
> >>         > wrote:
> >>         >         Since most of the contents are changed, could you
> >>         please
> >>         >         attach the file also? Thank you very much.
> >>         >
> >>         >         2012/4/13 Gang Yu <yugang...@gmail.com>
> >>         >                 Hi,
> >>         >
> >>         >                    We have updated the kdriver script for
> >>         linux kernel
> >>         >                 build. The kdriver build script was
> >>         contributed by
> >>         >                 Dongyuan's team, Tsinghua University at 2009
> >>         around
> >>         >                 for linux 2.6.27 build. We made some changes
> >>         to the
> >>         >                 old version, including:
> >>         >
> >>         >                 *). we change this bash script to a perl
> >>         script. This
> >>         >                 is for some considerations:
> >>         >                    - parsing command line arguments. bash
> >>         shows its
> >>         >                 limitations on parsing the command line like
> >>         >                 -DIPATH_IDSTR='"QLogic kernel.org driver"'
> >>         as a
> >>         >                 monotonic argument
> >>         >                    - handling the regular expressions and
> >>         maintaining
> >>         >                 good program shape, perl is easier
> >>         >
> >>         >                 *). The script is writing in a relative more
> >>         general
> >>         >                 style.
> >>         >                   - no hard coded targets and optimization
> >>         >                 levels, user can specifiy the optimization
> >>         level and
> >>         >                 more arguments in the command line rather
> >>         than using
> >>         >                 Makefile default.
> >>         >                   - tuning arguments can be specified for
> >>         targets
> >>         >                 and optimizations.
> >>         >
> >>         >                 *). we add a dump functionality, i.e,
> >>         command line
> >>         >                 processed by kopencc now also dumped to
> >>         stderr. In our
> >>         >                 practice, this will help the programmers
> >>         debugging the
> >>         >                 build issues.
> >>         >
> >>         >                 The kernel building command is still
> >>         >
> >>         >                 cd /path/to/kernel/source
> >>         >                 make -j 8 V=1 CC="kopencc"
> >>         O=/path/to/build_dir
> >>         >                 or
> >>         >                 make -j 8 V=1 CC="kopencc -O0"
> >>         O=/path/to/build_dir
> >>         >
> >>         >                 we have tested the script on kernel 2.6.32.6
> >>         and
> >>         >                 3.0.25 X86_64 target build.
> >>         >
> >>         >                 Could a gatekeeper please help a review?
> >>         thanks a lot.
> >>         >
> >>         >                 Regards
> >>         >                 Gang
> >>         >
> >>         >
> >>         >
> >>         >
> >>
> ------------------------------------------------------------------------------
> >>         >                 For Developers, A Lot Can Happen In A
> >>         Second.
> >>         >                 Boundary is the first to Know...and Tell
> >>         You.
> >>         >                 Monitor Your Applications in Ultra-Fine
> >>         Resolution.
> >>         >                 Try it FREE!
> >>         >                 http://p.sf.net/sfu/Boundary-d2dvs2
> >>         >
> >>         _______________________________________________
> >>         >                 Open64-devel mailing list
> >>         >                 Open64-devel@lists.sourceforge.net
> >>         >
> >>         https://lists.sourceforge.net/lists/listinfo/open64-devel
> >>         >
> >>         >
> >>         >
> >>         >
> >>         >         --
> >>         >         Regards,
> >>         >         Lai Jian-Xin
> >>         >
> >>         >
> >>
> ------------------------------------------------------------------------------
> >>         > For Developers, A Lot Can Happen In A Second.
> >>         > Boundary is the first to Know...and Tell You.
> >>         > Monitor Your Applications in Ultra-Fine Resolution. Try it
> >>         FREE!
> >>         > http://p.sf.net/sfu/Boundary-d2dvs2
> >>         > _______________________________________________ Open64-devel
> >>         mailing list Open64-devel@lists.sourceforge.net
> >>         https://lists.sourceforge.net/lists/listinfo/open64-devel
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > For Developers, A Lot Can Happen In A Second.
> > Boundary is the first to Know...and Tell You.
> > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> > http://p.sf.net/sfu/Boundary-d2dvs2
> > _______________________________________________
> > Open64-devel mailing list
> > Open64-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/open64-devel
>
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to